I'm migrating our WCF web services to ServiceStack. Supose we have 3 entities. Let them be A, B and C.
- A is father of B.
- A is father of C.
In WCF we would have 3 methods to get A with his children:
public List<A> GetAWithBIncluded()
{
return Repository.A.Include("B").ToList();
}
public List<A> GetAWithCIncluded()
{
return Repository.A.Include("C").ToList();
}
public List<A> GetAWithBAndCIncluded()
{
return Repository.A.Include("B").Include("C").ToList();
}
I'm having enormous difficult to translate this process to ServiceStack manner. Can you guys provide some examples?
The best I came up with is:
public class AResponse
{
public List<A> As {get;set;}
....//One list of each type.
}
We know we cannot use WCF with lazyloading, but can ServiceStack and ormlite do the trick of fully automated process of data access without overcharging the application?