Skip to content

Commit f8a7763

Browse files
authored
chore: Merge pull request #888 from DocSvartz/Fix-#881
Fix #881 - ProjectToType record regression
2 parents a14b54e + 6e69ad8 commit f8a7763

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Mapster/Adapters/RecordTypeAdapter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ internal class RecordTypeAdapter : ClassAdapter
1919

2020
protected override bool CanMap(PreCompileArgument arg)
2121
{
22-
return arg.DestinationType.IsRecordType() && arg.MapType != MapType.Projection;
22+
return arg.DestinationType.IsRecordType();
2323
}
2424

2525
protected override bool CanInline(Expression source, Expression? destination, CompileArgument arg)
2626
{
27+
if(arg.MapType == MapType.Projection)
28+
return true;
2729
return false;
2830
}
2931

3032
protected override Expression CreateInlineExpression(Expression source, CompileArgument arg, bool IsRequiredOnly = false)
3133
{
32-
return base.CreateInstantiationExpression(source, arg);
34+
return CreateInstantiationExpression(source, arg);
3335
}
3436
protected override Expression CreateInstantiationExpression(Expression source, Expression? destination, CompileArgument arg)
3537
{

0 commit comments

Comments
 (0)