How can I load object with dependencies via Invoke method?
E.g. I have a DTO:
[DataContract]
public class MyDTO
{
[DataMember]public int Id{get;set;}
[DataMember] public string SomeField {get;set;}
[DataMember][Include]public IList< SomeEntity > Dependencies {get;set} }
And invoke method:
[Invoke]
public MyDTO GetDTO()
{
return new MyDTO() { Id=1, SomeFields="Test", Dependencies=new List< SomeEntity >(){new SomeEntity()}; }
In this case on client side I can attach MyDTO instance to main domain context, but Dependencies don't load. I don't want to create new method to get Dependencies separatelly.If create query method instead invoke I should work with IEnumerable but I need only one instance. What is the best way to resolve that? Thanks.