Exemplo n.º 1
0
        public static DAL.User FromBusinessToDataAccessMap(User user)
        {
            var User           = user ?? throw new ArgumentNullException("user");
            var dataAccessUser = new DAL.User()
            {
                Id       = user.Id,
                UserName = user.UserName,
                Password = user.Password,
                RoleId   = user.Role.Id
            };

            return(dataAccessUser);
        }
Exemplo n.º 2
0
        public static User FromDataAccessToBusinessMap(DAL.User user)
        {
            var User    = user ?? throw new ArgumentNullException("user");
            var dTOUser = new User()
            {
                Id       = user.Id,
                UserName = user.UserName,
                Password = user.Password,
                Role     = new Role()
                {
                    Id   = user.Role.Id,
                    Name = user.Role.Name
                }
            };

            return(dTOUser);
        }