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