Joining Events with options

问题内容:

Database Architecture Question

I’ve got following classes:

 public class Member
{
    public int ID { get; set; }
    public Char Gender { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
}

public class Event
{
    public int ID { get; set; }
    public virtual ICollection<Option> Options { get; set; }
}
public class Option
{
    public int ID { get; set; }
    public virtual ICollection<Event> Events { get; set; }
}

Now i wonder how to reach my goal:

There should be Events, with options attached. Now a Member should have the possibility to “join” an Event and select some options.

That means options were attached to an event and members can be attached to an event with many options.

Example:

User A joins event “A” with options One and Two
User B joins event “A” just with option One

Any ideas / help for me?
I’m working with Fluent API, but have no idea about the Relationships i have to do

╔═══╦═════════╦═════════╦═════════╦═════════╦═════════╗
║ ║ EventID ║ Option1 ║ Option2 ║ Option3 ║ Option4 ║
╠═══╬═════════╬═════════╬═════════╬═════════╬═════════╣
║ ║ Event1 ║ Members ║ Members ║ Members ║ Members ║
╠═══╬═════════╬═════════╬═════════╬═════════╬═════════╣
║ ║ Event2 ║ Members ║ Members ║ Members ║ Members ║
╠═══╬═════════╬═════════╬═════════╬═════════╬═════════╣
║ ║ Event3 ║ Members ║ Members ║ Members ║ Members ║
╚═══╩═════════╩═════════╩═════════╩═════════╩═════════╝

问题评论:

1  
Add some sample table data and the expected result. (Formatted text, please. Not images.)

原文地址:

https://stackoverflow.com/questions/47755562/joining-events-with-options

添加评论