// read Role of user from database protected virtual void EnsureRoles() { using (var context = new ServiceQualityControlEntities()) { var roles = context.UserRoleInfos.ToList(); foreach (var userRoleInfo in roles) { _roles.Add(userRoleInfo.Role); } } }
public UserModel() { Context = new ServiceQualityControlEntities(); }