.net programming, computers and assorted technology rants

Handle Many-to-Many Relationships in Entity Framework and ASP.NET MVC

Courtesy Peter Vogel, VisualStudioMagazine

It’s not unusual to have many-to-many relationships in an application. A recent project I worked on had multiple service technicians assigned to multiple locations, for instance. It’s also not unusual for there to be data that applies only to the relationship. In my client’s project, for example, at any location, a service technician has a specific position — and that position can be different from one location to another. (For instance, at one location, the tech might be the "responsible authority"; at another location, the tech might be the "support technician.") In addition, at each location, a tech is assigned a phone extension number where he can be reached.

In this column, I’ll work through this problem using Entity Framework Code First development, LINQ and (for the UI) ASP.NET MVC. By the end of the column you’ll have a roadmap for handling many-to-many relationships in your applications.

Read More:



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s