POCO Entity Structure + Recommended Templates

We really like EntityFramework (CTP5) and its use with ASP.NET MVC3.

I do not like; things are mixed together.

I can put DisplayAttribute , RequiredAttribute , RangeAttribute , CompareAttribute together in one class, which means I'm am mixin in database validation , business logic and user interface . I can even place the ScriptIgnore attribute to configure it as a Json DTO object . Therefore, I can use the same POCO class for Persistance, Presentation, DTO and Business Object, as well as for my domian model.

What design patterns do you complete with the EF POCO + MVC3 toolkit? What are your layers? What features do you add to your classes (is your POCO class also your domain model)

+3
source share
2 answers

View Models . . EF-, EF ( AutoMapper) . , , . . , , EF, .

: . EF . , : , , /. , Id . Id . , , Id.

+8

POCO , .

" " ( JsonResult). UI . ( crud) - - , , ( ViewData ).

, /, , UI.

DDD, POCO = , , , , . , - . , DTO, .

+3

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


All Articles