为什么实体框架需要POCO [英] Why POCO is required in entity framework

查看:72
本文介绍了为什么实体框架需要POCO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我刚刚开始学习.net 4.0的实体框架.但是我不明白其中是否需要POCO(普通旧CLR对象).

如果您有任何想法,请通过一些很好的例子告诉我POCO的需求.等待您的答复.在此先感谢..:):)

Hi,

I have just started learning entity framework for .net 4.0. But I didn''t understand the need of POCO(Plain Old CLR Object) in it.

Please let me know the need of POCO with some good example if you have any idea. Waiting for your response. Thanks in advance..:):)

推荐答案

一个好的起点在这里:
http: //blogs.msdn.com/b/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx [ http://thedatafarm.com /blog/data-access/agile-entity-framework-4-repository-part-1-model-and-poco-classes/ [ http://huyrua.wordpress.com/2010 /07/13/entity-framework-4-poco-repository-and-specification-pattern/ [
a good starting point is here:
http://blogs.msdn.com/b/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx[^]

and here:

http://thedatafarm.com/blog/data-access/agile-entity-framework-4-repository-part-1-model-and-poco-classes/[^]

POCO''s are used all over the place and commonly used as DTO''s (Data transfer objects) via data services. POCO''s are literally objects that just have properties which are populated via routines. The POCO properties will / should only have well known .net types such as string, int, double etc...

added to the above, used with the Repository and Unit of Work pattern these "Basic" objects will be extreamly important to data operations.
http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/[^]


这篇关于为什么实体框架需要POCO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆