In my previous post I wrote about first steps in creating Rest-full API by using ApiController . Now it`s time to make next step and go a little bit dipper inside web services created in MVC. In this post I want to describe two very important aspect: creating a real life scenario for web service implementation of POCO entity extend presented scenario and make it asynchronous To complete this tutorial one more class is needed. This class is a simple fake of some database which is wrapper around a very few collections and allow all CRUD operation. Moreover the implementation of this fake database uses a singleton design pattern to prevent creating instance of it each time and maintain state between web service calls. Code Snippet /// <summary> /// Represents a fake database. /// </summary> public sealed class FakeDbContext { private static volatile FakeDbContext instance; private
Damian Zapart, Principal Engineering Manager @ Microsoft - official blog.