Code-First Development with Entity Framework 5.0

By Tim Daniels
As you know from previous posts, I prefer using an Object Relational Mapping (ORM) framework, as part of a domain driven approach to design and development of a business solution. The Microsoft ADO.NET Entity Framework is an Object Relational Mapping framework that enables developers to work with relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that developers usually need to write. Developers can focus on their application-specific business logic rather than the data access fundamentals.

Recent development in the ADO.NET Entity Framework provide further support for two other software development techniques, which I find very appealing and effective, in design and development of new solutions.

  • Code-First Development Workflow
  • Convention over configuration

The code first approach offers several advantages to the application developer. It allows the developer to focus on domain specific entity classes and how these classes relate to each other in the business model. These classes are completely independent of a database source, the ORM and any third-party attributes. They are also independent of any base class inheritance. These classes are sometimes refered to as plain old common language runtime objects or POCO classes.

The entity classes form a set of conventions which the ADO.Net Entity Framework uses to automatically generate an object model and a SQL Server relational database.

Here is an example of two POCO entity classes. A time sheet object and a time sheet entry object. There is a one to many relationship between the time sheet object and the time sheet entry objects. This relationship is expressed by the TimeSheetEntries property of the TimeSheet class. This is known as a navigational property.

In the near future, I’ll be writing a series of posts on the Code-First development workflow, and then follow-up with a post on how code first ties into the convention over configuration development technique.

Here are several helpful links to help you get familiar with Entity Framework Development Workflows and the code-first workflow.

4 thoughts on “Code-First Development with Entity Framework 5.0

  1. google plus app for android

    I think that everything composed was very logical. But, think about this, suppose you typed a catchier post title?
    I ain’t saying your content is not good., but suppose you added a title that makes people desire more?

    I mean Code-First Development with Entity Framework 5.0
    | The Lexicon of Software is a little boring. You might look at Yahoo’s home
    page and see how they create post headlines to grab people interested.

    You might add a video or a related pic or two to grab readers interested about everything’ve got
    to say. Just my opinion, it would bring your posts a little
    bit more interesting.

    Reply
  2. Pingback: Navigation Properties in ASNA Visual RPG (AVR) | The Lexicon of Software

  3. Tommie

    Whats up are using WordPress for your blog platform?
    I’m new to the blog world but I’m trying to get
    started and set up my own. Do you need any coding expertise to make your own blog?
    Any help would be really appreciated!

    Reply
    1. Tim Daniels Post author

      Hello Tommie,

      WordPress is one of the most popular blog platforms. It is easy to setup and use, and does not require any knowledge of coding or computer programming. Here is a helpful link to a blog site for beginner bloggers.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">