示例#1
0
 public static UserDto AsDto(this UserDocument document)
 {
     return(new UserDto
     {
         Id = document.Id,
         CreatedAt = document.CreatedAt,
         Email = document.Email,
         Permissions = document.Permissions ?? Enumerable.Empty <string>(),
         Role = document.Role
     });
 }
示例#2
0
 public static User AsEntity(this UserDocument document)
 {
     return(new User(document.Id, document.Email,
                     document.Password, document.Role, document.CreatedAt, document.Permissions));
 }