|
|
@ -10,11 +10,19 @@ namespace Model.Mappers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new User(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin);
|
|
|
|
return new User(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static UserEntity FromDTOToEntity(this UserDTO dto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new UserEntity(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static User FromEntityToModel(this UserEntity entity)
|
|
|
|
public static User FromEntityToModel(this UserEntity entity)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new User(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin);
|
|
|
|
return new User(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static UserDTO FromEntityToDTO(this UserEntity entity)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new UserDTO(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static UserDTO FromModelToDTO(this User user)
|
|
|
|
public static UserDTO FromModelToDTO(this User user)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -25,5 +33,6 @@ namespace Model.Mappers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new UserEntity(user.Id, user.Username, user.Password, user.Email, user.IsAdmin);
|
|
|
|
return new UserEntity(user.Id, user.Username, user.Password, user.Email, user.IsAdmin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|