using (var dataContext = new realtydbEntities())
{
var user =
(
from aspnet_Roles rol in dataContext.aspnet_Roles.Include("aspnet_Users")
from aspnet_Users usr in rol.aspnet_Users
where rol.RoleId == roleID
select usr
);
return user.ToList();
}
I want use
usr.MemberShip.Email
MemberShip is a foreign table’s foreign table.
aspnet_Roles->aspnet_Users->Membership.Email
but i got an error: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
How can i include the membership object to the result??????
You will most probably need to include the aspnet_Membership table that hangs off the aspnet_User table as below: