LINQ: Entity intro

Draft…

Lessons learned while trying to learn ORM mapping with LINQ in .NET.

History:

  • .NET 3.0: Several language extensions added needed for LINQ.
  • .NET 3.5: LINQ to Objects, LINQ to XML and LINQ to SQL added. Unmapped relation between entity and a table possible. Table per Hierarchy inheritance possible.
  • .NET 3.5 SP1: LINQ to Entities added. Mapped relation between entity and a table possible. Table per subclass and Table per Concrete class inheritance possible. A mapping layer is put between the entity classes and the physical tables.

Inheritance Mapping

For performance, capacity and physical location reasons entities with inheritance is storred in different ways. See picture.

Seen from the class view then the discriminator TypeVehicle is superfluous, since the relation to the parent is expressed through the inheritance declaration in the derived class.
When I become wiser then I might learn the best practice.

See also: http://www.hibernate.org/hib_docs/reference/en/html/inheritance.html

More info

Namespace:  System.Web.DynamicData.
Code is in an assembly of same name.

Testing the “Dynamic Data Entity Web App” template

– Create a “Dynamic Data Entity Web App”

– Default.aspx – View in Browser => Error:
“There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages.”

OK, some mapping to some tables has to be done! How?

More to come…..

Links

 

The end

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: