alkampfer on February 28th, 2009

Manage Tree With Entity Framework – The basic One of the most obvious problem showed in previous post is the need to issue a single Select for each node to rebuild the tree, but the good thing is that there are a lot of solutions over there to solve this problem. One of the most [...]

kick it on DotNetKicks.com

Continue reading about Manage trees with entity framework part II

alkampfer on February 27th, 2009

Quite often you need to store in database Hierarchical structure that are logically represented by a tree. There are a lot of techniques around there, but one of the most common is using a simple foreign key that refers to the same table, as in the following example If you map this table with entity [...]

kick it on DotNetKicks.com

Continue reading about Manage Trees with entity framework

alkampfer on February 25th, 2009

I have a local copy of my blog in my machine, just to test if I need to do some modification to the skin or to some pages of the blog, everything is always gone ok, just installing php, mysql and the blog works great. Today I need to reinstall php and mysql because my [...]

kick it on DotNetKicks.com

Continue reading about PHP odyssey

alkampfer on February 18th, 2009

In previous post I left to the reader the task to build a LoadByKey extension method to make it easy loading entities by key in project with entity framework, I think that is quite interesting to spent a little bit on in. First of all I suggest you to read this post about metadata and [...]

kick it on DotNetKicks.com

Continue reading about Extension method to add LoadByKey to EntityFrameworks context

alkampfer on February 18th, 2009

Suppose you generate an Entity Framework model on standard northwind database, you have a customer id and you want to generate an order for that customer. A possible solution is using (ModelTestBase context = new ModelTestBase()) { Orders order = new Orders(); order.Freight = 1.0M; order.RequiredDate = order.OrderDate = DateTime.Now; order.Customers = context.Customers.Where(c => c.CustomerID [...]

kick it on DotNetKicks.com

Continue reading about Entity Framework relations and entityKey