开发者

MVVM How and where to 'Get Item By Id'

I want to abstract data access from my model. I have classes that have collections of other objects and also primary item of object by id.

I need a static GetItemById call from the model for adding these items from the model abstracted from any data access.

How does one go开发者_运维问答 about it?

FYI I'm currently building the model.


Sounds to me like a use for the repository pattern http://msdn.microsoft.com/en-us/library/ff649690.aspx (this is a sharepoint example but you can easily find info on general repository patterns in DDD literature)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜