Ok, I\'m trying to figure out how to setup my DB properly.
I have two classes:
public class Event
{
public int EventId { get; set; }
public stri
It would still be quite similar to your question yesterday. See http://www.codeproject.com/Articles/234606/Creating-a-Many-To-Many-Mapping-Using-Code-First for a good blog post on the subject.
public class Event
{
public int EventId { get; set; }
public string EventName { get; set; }
public ICollection Dogs { get; set; }
public Event()
{
Dogs = new HashSet();
}
}
public class Dog
{
public int DogId { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public ICollection Events { get; set; }
public Dog()
{
Events = new HashSet();
}
}
The idea behind the code above (and from your previous question) is A dog can have a "collection" of events it is associated with, and events can have a collection of dogs that are associated to it.