I'm having a problem getting my head wrapped around EF6.
I have the following tables:
AspNetUsers (entity provided by MVC)
ICSProfile
ICSEvent
ICSVehicle
ICSEventClass
ICSEventEntry
I want to associate them as follows:
0) A given AspNetUser can have one ICSProfile record. A given profile can have one or more ICSVehicle records.
1) A given ICSProfile can have one or more ICSEvents. An event can have one or more ICSEventClasses.
(this is where I'm a bit dodgy)
2) A given ICSProfile can enter one or more vehicles in an ICSEvent one or more times, but each entry for a given vehicle has to be in a different ICSEventClass within the ICSEvent.
So, let's say our vehicle owner's name is John, and he has a 2012 Mustang, and a 1967 Mustang. Let's also say that user Bob has created an event that has three classes:
2005-2014 Mustang
1965-1973 Mustang
Street Machine, All
John wants to enter his 2012 Mustang in the
2005-2014 Mustang
class, as well as the
Street Machine All
class, and finally he wants to enter his other car into the
1965-73 Mustang
class.
What I have tried:
So far, my entity diagram looks like this:
AspNetUser(1)<--->(1)ICSProfile(1)<--->(*)ICSVehicle(1)<--------------------------\
| |
| |
| |
(*)ICSEvent(1)<-->(*)ICSEventClass(*)<-->(*)ICSEventEntry(*)<---/
Is that right? Does it look weird? It looks like a big circle (and circles are usually bad when you're writing code).
If I didn't explain this well enough, let me know, and I'll modify the question.