Skip to content

Commit 6e69ad8

Browse files
committed
fix: #881 - ProjectToType record regression
1 parent 73620c0 commit 6e69ad8

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)