amyiee 0 Newbie Poster

Hi Guys,

I'm new to ASP.NET MVC, so please pardon me if I mentioned wrong terminology on my question

I'm trying to create an application for a soccer related application. Right now I'm trying to design database/class structure for my application. However I run into a problem when I'm trying to define an appropriate class structure/business logic to represent a soccer match. On every match 2 teams commonly play, and each team has different attributes (e.g. numbers of red cards, yellow cards and goals it receives), My question is how could you or would you define that business rule in your entity framework structure? Would it be appropriate for me to use inheritances relationship between those classes? Here is what I've currently done:

Right now I've created:

Match Class with these attributes:

* MatchID
* Date
* HomeTeam
* AwayTeam

HomeGame

* MatchID
* TeamID
* YellowCards
* RedCards
* Goals

AwayGame

* MatchID
* TeamID
* YellowCards
* RedCards
* Goals

My question is what sort of relationship should I used to represent such business logic, perhaps inheritances, or would it be appropriate to use collection of class (Many to many relationship) instead?

I will gladly appreciate your input and/or suggestion

Thanks heaps!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.