Hi. I'm a newbie to WCF, trying to perform relatively simple task. I'm trying to return list of objects read from the database but cannot overcome some really annoying exceptions. The question is very simple? What's wrong with the picture?
[ServiceContract]
public interface IDBService
{
[OperationContract]
string Ping(string name);
[OperationContract]
InitBDResult InitBD();
}
public InitBDResult InitBD()
{
_dc = new CentralDC();
InitBDResult result = new InitBDResult();
result.ord = _dc.Orders.First();
return result;
}
[DataContract]
public class InitBDResult
{
//[DataMember]
//public List<Order> Orders { get; set; }
[DataMember]
public Order ord { get; set; }
}