I have a create a Wcf Service using WcfPortal.It exposes basic method Fetch,Delete,Insert and Update. I use this Service in my MVC project as below
ServiceReference2.WcfPortalClient obj = new ServiceReference2.WcfPortalClient();
Application App = new Application();
var AppType = App.GetType();
ApplicationCriteria Criteria = new ApplicationCriteria {ApplicationName = "application" };
ServiceReference2.FetchRequest Fetch1 = new ServiceReference2.FetchRequest();
CslaTest.ServiceReference2.DataPortalContext context = new ServiceReference2.DataPortalContext();
Fetch1._context = context;
Fetch1._objectType= AppType;
Fetch1._criteria = Criteria;
var list = obj.Fetch(Fetch1);
But when i compile my project i get error as:
Type 'CslaTest.BusinessLibrary.ApplicationCriteria' with data contract name ApplicationCriteria:http://schemas.datacontract.org/2004/07/CslaTest.BusinessLibrary' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'