Block diagram 4 for display in POCOs

I created a new entity data model for my database and manually created POCO objects for this to display them, and all this works fine.

The problem is that now I want to rename the properties in my POCO objects so that they differ from the field names in the database, for example, I want UserID, not user_id, when I do this, it is obvious that EF can no longer bind object to POCO object. Is there a way I can do this? Maybe decorating the properties with attributes to say which cards to them?

+3
source share
2 answers

You can change it in Entity Designer. Annie's Data Model (EDM) contains 3 main parts:

  • . .
  • . .
  • Mapping. .

POCOs "" . Edmx Model Designer. .

+3

POCOs Code First EF CTP 4. Code First POCO / . .edmx mapping, . , ala Fluent nhibernate, , EF CTP5 .

, .

http://theminimalistdeveloper.com/2010/07/28/how-to-map-pocos-to-existing-databases-in-entity-framework-4-0-code-first-and-asp-net-mvc-2/

+2

Source: https://habr.com/ru/post/1756157/


All Articles