What is POCO in the Entity Framework?

I just started to learn POCO, but I can not understand its uses and advantages. Even the following stackoverflow link didn't help me.

What is Entity Framework with POCO

Can someone explain the use of POCO with a simple example?

+61
c # entity-framework poco
Apr 18 '13 at 5:37 on
source share
1 answer

POCOs (Plain old CLR objects) are just objects in your domain. Usually, when we use the entity infrastructure, entities are automatically generated for you. This is great, but unfortunately these objects alternate with database access functionality, which is clearly contrary to SOC (Separation of Anxiety). POCOs are simple objects without any data access functions, but EntityObject functions, such as

  • Lazy loading
  • Change tracking

Here is a good start for this.

POCO Entity Structure

You can also easily create POCO from an existing Entity infrastructure project using code generators.

EF 5.X DbContext Code Generator

+75
Apr 18 '13 at 5:44 on
source share



All Articles