Designing Web API Versioning

Prashant Brall's Blog

In this post I am going to talk about some of the commonly used Web API versioning strategy and hope it will help you decide which one is best suitable for your scenario.You will also see that there is no right or wrong way of designing them but I am always about options and different approaches, ultimately it is you who have to decide which approach is best suitable for you.

Uri based approach:

In this type of versioning strategy the versioning is embedded in the URI and probably the most popular one.However I personally think it is quite anti-REST as with each version the URI changes. REST is very resource oriented and it means once you have defined the URI(address) to the resource then it shouldn’t change just because you have a new version of that resource. This also means that the physical URI surface area will…

View original post 779 more words

MVC WEB HTTP, HTTPS Application Monitoring Tools

Software Engineering

This is just a collection of links, tools for monitoring, testing, tracing, debugging ASP.NET applications. When I have time I’ll evaluate each of the different tools.

Health Monitoring and ASP.NET MVC

Log exceptions with Health Monitoring in ASP.NET MVC3

Health Monitoring with ASP.NET MVC






Responsive Design Test Tools

Reverse Proxies for Mobile development


View original post

OpenLiveWriter Version Of Syntax Highlighter Plugin Available Now

In case you hadn’t heard the excellent Windows Live Writer has gone Open Source and is being kept alive by the community. It’s now called OpenLiveWriter. This is great news as it is a really useful tool, used by many, that was looking like being left to die by Microsoft. For more information check out these links:

Scott Hanselman’s post:

The .Net Foundations post:

The official OpenLiveWriter blog is here:

These are very early days for OpenLiveWriter and it looks like it will go through some changes as it evolves, including the way that it handles plugins. Despite the expectation that a lot will break through this evolution I have worked on updating my Syntax Hightlighting plugin for to work with OpenLiveWriter.

Updating the plugin to work with OpenLiveWriter was fairly straight forward thanks to the OpenLiveWriter SDK NuGet Package which can be found here:

View original post 298 more words

Generating Swagger example responses with Swashbuckle

Matt's work blog

Swashbuckle is a tool for generating Swagger, the API description language, from your ASP.NET Web Api solution.
Using Swashbuckle, which provides Swagger-UI, you can create pretty living documentation of your web api, like this:

Documenting the Response

In this post I am going to show you how to document the Response, and a new way to generate some response examples.

You can specify the type of response for Swashbuckle a number of ways. Consider a simple API endpoint which returns a list of Countries:

One way of describing the response code and content for Swashbuckle is using a combination of XML comments, and the ResponseType attribute, like so:

However, this only allows for one type of response.

If your API method can return multiple types, i.e. in the case of an error, then you can use the new SwaggerResponse attribute:

The Swagger 2.0 spec allows for examples to be…

View original post 119 more words

ASP.NET Web API Unit Testing

chsakell's Blog

Unit testing can be beneficial to many aspects in software develepment, from the lowest level that is the source code to the highest level and the end user’s experience. Writing automated tests helps finding defects earlier in the development lifecycle process which leads to fewer late nights or weekend work (happier developers). Since defects are resolved before production, less defects reach end users (happier clients). It also increases reliability of source code, since if the base code doesn’t change all tests should always return the same results. Last but not least, anyone that decides to write unit tests is also forced to write testable code which leads to better software development practices.

Web API Unit Testing

ASP.NET Web API stack has many aspects that firstly must be well understood before writing unit tests against it and that’s what makes it difficult. This post is a full stack Web API Unit…

View original post 1,949 more words

Voxel editor


I’ve been looking for some voxel-editors and found a few that are gratis:

  • MagicaVoxel: looks very nice, however, it is closed source and no Linux build is available;
  • Zoxel: open-source, but rather limited;
  • VoxelShop: closed-source, seems to work fine.

However, creating voxels manually is rather tedious work. So, I would like to generate them using a script. Furthermore, my voxel renderer supports some features that are not available elsewhere. For example, one can use extruded triangles as ‘leaf-nodes’ instead of tiny cubes, because nodes in a voxel octree can refer to themselves.

Hence, I decided that I want to make my own voxel editor. One that will be purely script based. So, if you want to make a single change, you have to change the script that generated it and re-execute that script. As scripting language I’ve chosen Lua, because it is almost trivial to create c++…

View original post 291 more words

Second Level Cache for EF 6.1

Code, the Universe and everything...

See what’s new in Beta here.

Currently Entity Framework does not natively support second level caching. For pre-EF6 versions you could use EF Caching Provider Wrapper but due to changes to the EF provider model in EF6 it does not work with newest versions of EF. In theory it would be possible to recompile the old caching provider against EF6 but, unfortunately, this would not be sufficient. A number of new features breaking some assumptions made in the old caching provider (e.g. support for passing an open connection when instantiating a new context) have been introduced in EF6 resulting in the old caching provider not working correctly in these scenarios. Also dependency injection and Code-based Configuration introduced in EF6 simplify registering wrapping providers which was rather cumbersome (especially for Code First) in the previous versions. To fill the gap I created the Second Level Cache for EF…

View original post 1,278 more words

The final version of the Store Functions for EntityFramework 6.1.1+ Code First convention released

Code, the Universe and everything...

Today I posted the final version of the Store Functions for Entity Framework Code First convention to NuGet. The instructions for downloading and installing the latest version of the package to your project are as described in my earlier blog post only you no longer have to select the “Include Pre-release” option when using UI or use the –Pre option when installing the package with the Package Manager Console. If you installed a pre-release version of this package to your project and would like to update to this version just run the Update-Package EntityFramework.CodeFirstStoreFunctions command from the Package Manager Console.

What’s new in this version?

This new version contains only one addition comparing to the beta-2 version – the ability to specify the name of the store type for parameters. This is needed in cases where a CLR type can be mapped to more than one store type. In case…

View original post 395 more words

AttachedCommandBehavior V2 aka ACB

C# Disciples

YOUAfter publishing my AttachedCommandBehavior library, (you can read about this here), some WPF Disciples recommended some new features to make the library cover more use cases. Thanks William Kempf your input was amazing!

I added 2 new features

– Support for Collection of binding to commands
– Support for Light weight Commands or as I call them Action

Support for Collection of binding to commands

This is a very handy feature. Let’s say you want to hook a command to the MouseDown but also want to hook up to the MouseEnter event, in ACB v1 you could now do this because you could only Bind one command at a time. Now the ACB v2 is supporting a collection of what I call BehaviorBinding. This is really powerful because it enables you to hook up to N number of events. The code would look something like this

   1: <Border Background=

View original post 423 more words

WPF – Creating bindings in XAML by StaticResource

Shen HengBin's Blog

Here is a memo of how to create bindings in XAML .

As an example, let’s  look at the following snippet.

I have defined three types resource in above code.

  • PageTitle : String
  • FriendItemSource : List of custom class
  • ItemTemplate : DataTemplate of each item.

Then , We will add StaticResource into our XAML

  • Add xmlns reference to the namespace.
  • Add the static resources.


I had to wrap “x:Array ” in an ObjectDataProvider to get it to work, and replace

{StaticResource FriendItemSource}” to “{Binding Source={StaticResource FriendItemSource}}

or not , you will get an error like bellow

“Cannot convert the value in attribute ‘ItemsSource’ to object of type ‘System.Collections.IEnumerable’. ‘System.Windows.Markup.ArrayExtension’ is not a valid value for property ‘ItemsSource’ …”

The final effect looks as following

Full of  XAML source.

View original post