Posted by Ramani Sandeep on August 18, 2013
In this new article series you’ll see how to design and build an N-Layered ASP.NET application using ASP.NET MVC 4, ASP.NET 4.5 Web Forms and a number of other up-to-date technologies such as Entity Framework 5 and WCF.
In this series, I’ll build a sample application to manage contact people called the ContactManager v4.5 application, similar to the demo application demonstrated in the previous article series. Over the next 10 articles I’ll dissect the sample application (that you can download at the end of each article, starting with Part 2) and show you how I designed and built it.
Part 1 – Introduction
Part 2 – Setting up the Solution in Visual Studio
Part 3 – Making your Projects Unit Testable
Part 4 – Implementing a Model
Part 5 – Implementing a Repository using Entity Framework Code First
Part 6 – Implementing an ASP.NET MVC 4 Frontend
Part 7 – Implementing a Web Forms 4.5 Frontend
Part 8 – Implementing a WCF 4.5 Frontend
Part 9 – Importing Data Using the API
Part 10 – Extensions, Tools and Wrapping Up
More info click here.
Hope this will help !!!
Posted in ASP.NET 4.0, ASP.NET MVC, Entity Framework, WCF | Tagged: Making your Projects Unit Testable | Leave a Comment »
Posted by Ramani Sandeep on May 19, 2013
As a WCF developer you always get question from interviewer : “Can we implement Inheritance in WCF ServiceContract?“
Answer will be:
YES we can have Contract Inheritance in WCF. In other words in WCF one ServiceContract can inherit other ServiceContract.
Let us take an example which explain us how to achieve it.
You have a ServiceContract named IParentService as given below :
public interface IParentService
string ParentMessage(string message);
Another ServiceContract named IChildService can inherit IParentService as following :
public interface IChildService : IParentService
string ChildMessage(string message);
Next you need to decide on implemention of Service. Single Service class can implement both contract by implementing bottom most ServiceContract in hierarchy. In this case bottom most ServiceContract is IChildService Service can be implemented as following in a single service class:
public class Service1 : IChildService
public string ChildMessage(string message)
return "Hello " + message + "from Child Service";
public string ParentMessage(string message)
return "Hello " + message + "from Parent Service";
Now you have choice that either you can expose whole hierarchy as single EndPoint or different EndPoints for different Service Contract. To expose contract hierarchy create EndPoint with bottom most ServiceContract. In this case we are creating EndPoint with Service Contract IChildService . At the client side operations from whole hierarchy could be invoked.
Hope this will help !!!
Posted in WCF | Tagged: Inheritance, Inheritance in WCF | Leave a Comment »