This is my source code of my class in EDM:
public class People
{
public virtual int Id { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
}
This is my source code of my web service:
public
class PeopleWS : System.Web.Services.WebService
{
[WebMethod]
public List<Sistema> SelectPeoples()
{
MyContext db = new MyContext();
return (from q in db.People select q).ToList();
}
}
When I execute the web service this error is returned:
System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type System.Data.Entity.DynamicProxies.People_09C9616929F8A9A58DFD553684CF043860C1241DFD5E18195F34AFC1D05275B1 was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
How do I solve this problem?