OK here it goes:
I am programming a website in Asp.net MVC.
I've used the Users tables and all those extra tables which come with Asp.net for logging in, ...
Now, these users have roles. 1 of the roles is Teacher
, other roles are Admin, Manager, ...
I have a table called Lessons
Each lesson has 1 or more teacher. In the old DB there was a teacher table, connected to the lessons table via a subtable to have a more on more relationship.
Now i'd like to have a View or something which consists of all my users which have the "开发者_如何学Pythonteacher" role. Uptill here i can do it myself.
BUT, is it possible to have a dependency on a view so that my teachers and lessons are interconnected in my DBML file, or is there an other way?
how would you do it?
With Linq to SQL, you can create a view in your database, and drag it into your .DBML and query it the usual way. And, if you want the view to have a relationship to another table, you can manually create the associations in the DBML designer.
精彩评论