Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 internal static void Bind(UserModel user)
 {
     HttpContext.Current.Session[UserSessionKey] = user;
 }
Ejemplo n.º 3
0
 public CruderPrincipal(string authenticationType, UserModel user)
 {
     this.AuthenticationType = authenticationType;
     this.User = user;
 }