I tried return a IEnumerable in WCF service
IService1.cs
[OperationContract]
IEnumerable GetAllTasks(string PersonName);
Service1.cs
MyEntities db=new MyEntities ();
private IEnumerable getAllTask;
public IEnumerable GetAllTasks(string PersonName)
{
getAllTask= db.GetAllTaskOfPerson(PersonName).ToList();
return getAllTask;
}
Client
Service.ServiceClient ws=new Service.ServiceClient().ToList();
grid.DataSource=ws.GetAllTasks("John");
grid.DataBind();
I get this error :
An existing connection was forcibly closed by the remote host