c# - Entity framework trouble -


i need setup one-to-many relationship entity framework.

i trying build recipe, recipe can composed of recipes.

how achieve ef ?

public class recipe {     public recipe()     {         deleted = false;          recipes = new list<recipe>();     }      [key]     public int recipeid { get; set; }      public virtual list<recipe> recipes { get; set; } } 

i don't need whole recursive thing(parent, child) child i'm interested in. feasible using ef ? can point me right direction

ex:

recipe a

recipe b => a

recipe c

recipe d => b

recipe e => b, c

this many-to-many relationship, because each recipe can have multiple , multiple parent recipes. when create child recipes, have assign parent it, must define parent relationship well.

you try inverseproperty dataannotation, more info check out question: entity framework 4.1 inverseproperty attribute


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -