I am using Enity Framework to fetch data from my database. In WCF, my method has a return type of List<EmployeeTable>. But I can’t test my service in WCF test client.
Do I need to write my custom datacontract to return the fetched data.
Edit:
How can I handle this case:
var query = from c in customers
join o in orders on c.ID equals o.ID
select new { c.Name, o.Product };
It’s good practice to separate the DTOs from the service entities
What you’ll need to do is create a service employee class and implement converter methods from/to your employee DTO.
Then have your service operation return a list of service employees rather than list of DTOs.
As a starter:
and the method implementing your operation contract: