Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Record detection - Adapt To Class not create new instance #634

Merged
merged 11 commits into from
Oct 15, 2023
3 changes: 2 additions & 1 deletion src/Mapster.Tests/WhenIgnoringConditionally.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public void IgnoreIf_Can_Be_Combined()
public void IgnoreIf_Apply_To_RecordType()
{
TypeAdapterConfig<SimplePoco, SimpleRecord>.NewConfig()
.EnableNonPublicMembers(true) // add or
.IgnoreIf((src, dest) => src.Name == "TestName", dest => dest.Name)
.Compile();

Expand Down Expand Up @@ -187,7 +188,7 @@ public class SimpleDto
public string Name { get; set; }
}

public class SimpleRecord
public class SimpleRecord // or Replace on record
{
public int Id { get; }
public string Name { get; }
Expand Down
Loading