We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,089 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Choosing the right relationship on Entity Framework MVC ASP.NET

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!

1
Contributor
0
Replies
1
View
amyiee
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0625 seconds using 2.7MB