什么是POCO实体框架中? [英] What is POCO in Entity Framework?

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

问题描述

我刚开始学习POCO却无法了解其用途和优势。即使下面的计算器链接没有帮助我。

I just started learning POCO but cannot understand its use and advantage. Even following link of stackoverflow did not help me.

什么是实体框架与POCO

任何人可以用一​​个简单的例子来说明POCO的使用情况如何?

Can anybody explain the usage of POCO with a simple example?

推荐答案

POCOS(普通老式CLR对象)只是你Domain.Normally的实体,当我们使用实体框架的实体为you.This自动生成是很大的无奈这些实体中穿插进行,这显然是对SOC的数据库访问功能(关注分离).POCOS是没有任何数据访问功能简单的实体,但仍给人的能力,所有的 EntityObject 功能像

POCOS(Plain old CLR objects) are simply entities of your Domain.Normally when we use entity framework the entities are generated automatically for you.This is great but unfortunately these entities are interspersed with database access functionality which is clearly against the SOC(Separation of concern).POCOS are simple entities without any data access functionality but still gives the capabilities all EntityObject functionalities like


  • 延迟加载

  • 更改跟踪

下面是一个很好的开端

POCO实体框架

您也可以使用代码生成

EF 5.X的DbContext代码生成

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

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