Skip to content

Commit

Permalink
remove CreateBlockExpression section in RecortType Adapter.
Browse files Browse the repository at this point in the history
With the addition of InlineExpression it only creates extra code when updating
  • Loading branch information
DocSvartz committed Oct 24, 2023
1 parent a5f9018 commit 6e7283f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mapster/Adapters/RecordTypeAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override Expression CreateInstantiationExpression(Expression source, E
//new TDestination(src.Prop1, src.Prop2)

if (arg.GetConstructUsing() != null)
return base.CreateInstantiationExpression(source, destination, arg); // this propably can inline Field activation, I didn’t see issue where it was requested :)
return base.CreateInstantiationExpression(source, destination, arg);

var destType = arg.DestinationType.GetTypeInfo().IsInterface
? DynamicTypeGenerator.GetTypeForInterface(arg.DestinationType, arg.Settings.Includes.Count > 0)
Expand All @@ -38,7 +38,7 @@ protected override Expression CreateInstantiationExpression(Expression source, E

protected override Expression CreateBlockExpression(Expression source, Expression destination, CompileArgument arg)
{
return base.CreateBlockExpression(source, destination, arg);
return Expression.Empty();
}

protected override Expression CreateInlineExpression(Expression source, CompileArgument arg)
Expand Down

0 comments on commit 6e7283f

Please sign in to comment.