Open
Description
Hey, there.
I encountered an strange mapping bug, i am literally mapping from the same type to itself but an specific nested property gets null
(Order.Payment.CVV
)
here is the code:
public record CreateOrderRequest(OrderDTO Order);
public record CreateOrderCommand(OrderDTO Order) ;
public record OrderDTO
(
Guid Id,
Guid CustomerId,
string OrderName,
AddressDTO ShippingAddress,
AddressDTO BillingAddress,
PaymentDTO Payment,
OrderStatus Status,
List<OrderItemDTO> OrderItems
);
public record PaymentDTO
(
string CardName,
string CardNumber,
string Expiration,
string CVV,
int PaymentMethod
);
public void test(CreateOrderRequest request)
{
var tmp = request.Adapt<CreateOrderCommand>();
}
Mapster Version: 7.4.0
.Net Version: 8
PS. I have debugged the code and the CVV field does have a value before mapping