Exemple #1
0
 public static CustomerDto AsDto(this CustomerDocument document)
 => new CustomerDto
 {
     Id        = document.Id,
     State     = document.State.ToString().ToLowerInvariant(),
     CreatedAt = document.CreatedAt,
 };
Exemple #2
0
 public static CustomerDetailsDto AsDetailsDto(this CustomerDocument document)
 => new CustomerDetailsDto
 {
     Id              = document.Id,
     Email           = document.Email,
     FullName        = document.FullName,
     Address         = document.Address,
     IsVip           = document.IsVip,
     State           = document.State.ToString().ToLowerInvariant(),
     CreatedAt       = document.CreatedAt,
     CompletedOrders = document.CompletedOrders
 };
Exemple #3
0
 public static CustomerDto AsDto(this CustomerDocument document)
 => new CustomerDto
 {
     Id       = document.Id,
     Email    = document.Email,
     FullName = document.FullName,
     Address  = document.Address,
     IsVip    = document.IsVip,
     RegistrationCompleted = document.RegistrationCompleted,
     CreatedAt             = document.CreatedAt,
     CompletedOrders       = document.CompletedOrders
 };
Exemple #4
0
 public static Customer AsEntity(this CustomerDocument document)
 => new Customer(document.Id, document.Email, document.CreatedAt, document.FullName, document.Address,
                 document.IsVip, document.State, document.CompletedOrders);