Last active
December 10, 2015 13:18
-
-
Save chaos95/4440197 to your computer and use it in GitHub Desktop.
EF Collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
public class BigContainer | |
{ | |
[Key] | |
public virtual int BigContainerID { get; set; } | |
public virtual ICollection<LittleContainer> LittleContainers { get; set; } | |
} | |
public class LittleContainer | |
{ | |
[Key] | |
public virtual int LittleContainerID { get; set; } | |
public virtual BigContainer BigContainer { get; set; } | |
public virtual ICollection<TinyThing> TinyThings { get; set; } | |
} | |
public class TinyThing | |
{ | |
[Key] | |
public virtual int TinyThingID { get; set; } | |
public virtual LittleContainer LittleContainer { get; set; } | |
public virtual string TinyValue { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment