Posts

Showing posts with the label ASP.Net MVC

WCF - design a reliable, extendible and consistent data exchange between consumer and provider of services

Let me share with the community with what I've learnt and successfully implemented a generalised data response (data packet) exchanged between the consumer and the provider, in context to WCF services ..  The idea behind this concept is pretty simple! Instead of expecting a specific data type returned from the server call on its own, package that as part of a container that can facilitate not only the actual data expected by the consumer for a call to any service from the provider but additionally figure out if there were any validation/error that may have happened during that service call - all in one go!  The following is a simple implementation within the context of using ASP.Net MVC on the front-end and Entity Framework as a ORM tool (data layer) .. Step 1: PayLoad.cs (where the generic payload implementation lives)     [DataContract(Name = "PayLoadListUsing={0}")]     public class PayLoadList<TEntity>     where TEntity : clas...