I am using entity framework version 6 in my MVC5 application. I data model (.edmx) contains 2 entities User and Role corresponding to my tables in the database Users and Roles.
Users table contains columns: Id int, Name nVarchar(100), RoleId int (RoleId has foreign key constraint with Roles.Id)
Roles table contains columns: Id int, Name nVarchar(100)
My Entity model is generating the correct entities as per table structure.
Now when I am querying User entity (_db.Users.ToList()) from DB context, entity framework is looking for Role_Id column in user table instead of RoleId column, hence resulting in error.
So my question is why entity framework query generator is looking for Role_Id column while querying entity?