asp.net mvc - MVC 5 Scaffolding with inheritance uses the wrong entity set -


With MVC 5 and EF 6.1, I am using a simple succession hierarchy, where students from class students are to meet. My database reference for both classes is an entity set (DBset property):

  public class databaseContax: DBCOntax {public DBset & lt; Person & gt; Person {receive; Set; } Public DbSet & lt; Students & gt; Student {Received; Set; }}  

Now when I say Scholldler to be the controller for the student, the subclass, it uses the organization of individuals, such as

  Student's student = DB persons. Search (ID);  

Where the compiler clearly complains that it can not convert any student to any student.

Is there a way to ensure that Schollfolder uses the correct unit set (student in this case)?

Note that removing the organization of individuals is not a good solution, because other administrators are needed.

Why is not a foreign key to use a person who makes a relationship instead of heritage? This is the reason why you can db.students.find (personID) and db.person.find (personID)

to find all the details? Additional code but I can not think of any other way


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -