Tham khảo tài liệu 'pro entity framework 4 0 depositfiles_6', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | C H A P T E R 10 Code-Only Development When Microsoft set about to make the Entity Framework more flexible their goal was to provide developers with an environment in which they could create their model from one of their approaches. The first approach which has existed since the initial release of EF is the ability to generate your model from a database. Many of the chapters in this book have covered the new features and concepts that are tied to this approach. Chapter 9 covered the second approach model-first which lets developers start with a conceptual model and generate their database based on that conceptual model. This approach also lets developers customize DDL generation through T4 templates and Windows Workflow giving them the utmost flexibility and control over the creation and generation of the DDL. This is truly a model-first solution. This ability to customize is a giant step over EF in which you could define your conceptual model in EF but not do anything beyond that such as generate your database. This chapter will cover the third approach the code-only approach which provides developers the ability to use the Entity Framework using POCO entities and without an EDMX file. This approach lets developers view code as their model. There is a lot of discussion around the code-only approach such as whether code-only will contain much of the functionality found in a standard EDM model approach. The goal from the outset was to ensure that most if not all of the functionality found in the other two approaches model-first database-first is found in the code-only approach. This includes topics such as deferred lazy loading change tracking and complex types. And let s not forget new foreign key association support. This is included as well. In this chapter we will cover the code-only approach and discuss many aspects of building an EF project using code-only. We will build a simple example and we will also discuss some of the other aspects that you can add .