In my recent post on using OWIN and WebApi, I described how to separate your controllers into a separate DLL. Often the controllers need to call other methods that may need access to the base path of the web service (e.g. the bin folder).
The code below can be used to find that base path from other classes, without having to always pass a path parameter from method to method.
Just some random development ramblings mostly related to the Microsoft .NET platform.
Saturday, October 25, 2014
Thursday, October 23, 2014
OWIN hosting using a Separate WebApi Controller DLL
Here is a bare bones demonstration (4 minutes) showing you how to create a standalone class library of a WebApi controller, then hosting the controller in Microsoft's OWIN (in IIS). This is done using Visual Studio 2013 Update 3.
The video can be watched here: YouTube Watch
The source can be downloaded here: Download Source
What do you think?
The video can be watched here: YouTube Watch
The source can be downloaded here: Download Source
What do you think?
Sunday, October 12, 2014
WeightedRandom - Select content based on weights (C# / .NET)
Need to select content from a collection based on weights? Here is a great .NET 4+ class that is very helpful.
The class can be used with just about any collection and you can pass in a delegate/lamda to determine what the weight is on each collection object.
The class can be used with just about any collection and you can pass in a delegate/lamda to determine what the weight is on each collection object.
Subscribe to:
Posts (Atom)
Can't RDP? How to enable / disable virtual machine firewall for Azure VM
Oh no! I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore. I did ...
-
Oh no! I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore. I did ...
-
Here is a full test program that demonstrates how to use SharpZipLib to zip an XElement into a byte array. This allows you to transfer larg...