1
我将我们的WCF Web服务迁移到ServiceStack。根据我们有3个实体。让他们为A,B和CServiceStack和实体框架Lazy Loading
- A是B的父亲
- A是C. 的父亲
在WCF中,我们将有3种方法来获取与他的孩子:
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();
}
我很难将此过程转换为ServiceStack方式。你们能提供一些例子吗?
我想出的最好的是:
public class AResponse
{
public List<A> As {get;set;}
....//One list of each type.
}
我们知道我们不能用惰性加载使用WCF,但可以ServiceStack和ormlite做的数据存取完全自动化的过程的伎俩,而不滥的应用程序?
非常有趣的你的方法,我将离开开放的,现在看到更多的例子。 – Guardian
当然!看看其他人是否回答,他们会如何接近它,这很有趣! :) – CallumVass