private static UserModel MapUserEntityToModel(UserEntity userInstance) { UserModel model = null; if (userInstance != null) { model = new UserModel { Id = userInstance.Id, Fullname = userInstance.Fullname, Username = userInstance.Username, Password = userInstance.Password, Mail = userInstance.Mail, IsSystemAdmin = userInstance.IsSystemAdmin, UserGroup = new UserGroupModel { Id = userInstance.UserGroup.Id, Name = userInstance.UserGroup.Name, Description = userInstance.UserGroup.Description, Routes = userInstance.UserGroup.Routes.Select(q => new RouteModel { Action = q.Action, Controller = q.Controller, HttpMethod = q.HttpMethod }).ToList() } }; } return model; }
internal static void Bind(UserModel user) { HttpContext.Current.Session[UserSessionKey] = user; }
public CruderPrincipal(string authenticationType, UserModel user) { this.AuthenticationType = authenticationType; this.User = user; }