Last post Nov 20, 2013 01:34 AM by kaushalparik27
Nov 20, 2013 01:19 AM|manjay.bit2k7|LINK
I am new to WCF service and web service.
I have one requirement where I have DataAccessLayer where I have mapping to Employee class and I have a method called
Which take Employee as input parameter and saves New Employee to Database.
Now I want to expose this method in WCF service.
So I created a method
But I don't want to pass Entity class directly into this method as it will strongly bind my service method with Data access layer.
So How can I pass Employee class in this service.
Solution I tried : I created one New Emp class with same properties and fields as mapping class but this class was not passing directly
because of type mismatch so I inheritted this Emp class from Employee class and made Employee class serializable. It is resolving my issue.
But again when I am trying to create MVC strongly typed view from this class The view is not forming properly. So I think it is not the proper way to
create Data Contract. Can Someone please help?
Sorry for such such a long question
Nov 20, 2013 01:34 AM|kaushalparik27|LINK
Your approach is a bit correct. You may would like to create viewmodels .. not sure.. have a look at this thread:
hope it helps./.