Closed yyogesh closed 1 year ago
Your code example did not compile. The following change to the last line did compile and mapped as expected.
var userResponse = user.Adapt<UserResponse>();
Possibly that is what your code already has but when you do not mark <UserResponse>
as code the <UserResponse>
disappears in the comments.
Mapster giving issue with c# record no default contractor for type "Class_Name", Please use ConttructUsing or MapWith
public record User(int Id, string FirstName, string LastName);
public record UserResponse(int Id, string FirstName, string LastName);
var user = new User(1, "abc", "xyz");
var userResponse = user.Adapt();