Jack @ ASP.NET

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘code api’

Entity Framework Code First

The “EF Code-First” functionality provides a pretty nice code-centric way to work with data.

Advantage

  • ·         Develop without ever having to open a designer or define an XML mapping file, and start from a class
  • ·         Define your model objects by simply writing “plain old classes” with no base classes required
  • ·         Use a “convention over configuration” approach that enables database persistence without explicitly configuring anything
  • ·         Optionally override the convention-based persistence and use a fluent code API to fully customize the persistence mapping. columbus oh website design

Disadvantage

  • Mapping entities to the database is quite complex
  • There is no Model diagram

Entity Framework 4

Some of the big improvements in EF4 include:

  • POCO Support: You can now define entities without requiring base classes or data persistence attributes.
  • Lazy Loading Support: You can now load sub-objects of a model on demand instead of loading them up front.
  • N-Tier Support and Self-Tracking Entities: Handle scenarios where entities flow across tiers or stateless web calls.
  • Better SQL Generation and SPROC support: EF4 executes better SQL, and includes better integration with SPROCs
  • Automatic Pluralization Support: EF4 includes automatic pluralization support of tables (e.g. Categories->Category).
  • Improved Testability: EF4’s object context can now be more easily faked using interfaces.
  • Improved LINQ Operator Support: EF4 now offers full support for LINQ operators.

EF4 enables you to:

  • Develop without ever having to open a designer or define an XML mapping file
  • Define your model objects by simply writing “plain old classes” with no base classes required
  • Use a “convention over configuration” approach that enables database persistence without explicitly configuring anything
  • Optionally override the convention-based persistence and use a fluent code API to fully customize the persistence mapping