开发者

SubSonic SimpleRepository - Foreign Objects

开发者 https://www.devze.com 2022-12-15 06:51 出处:网络
SubSonic SimpleRepository doesn\'t seem to have a lot of support for foreign relations.How can I have foreign 开发者_如何学JAVArelationships in my code models that persist and load from the database n

SubSonic SimpleRepository doesn't seem to have a lot of support for foreign relations. How can I have foreign 开发者_如何学JAVArelationships in my code models that persist and load from the database naturally?


FKs are a DB concern - the Simple Repo is there to work as simply as possible so if you have a collection of child objects, you load them as needed:

public IEnumerable Kids{ get{ return Kids.All().Where(x=>x.ParentID==this.ID;
} }

You'd have to roll this by hand. If you want to "eager" load it - do on a case by case basis.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号