Skip to content

Commit

Permalink
efcore: generate noaction for ondelete (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvreony authored Dec 20, 2024
1 parent 2f1567f commit f07e5df
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ private StatementSyntax GetEfChildRelationshipInvocation(
"HasPrincipalKey",
new[] { $"principal => principal.Id" });

fluentApiInvocation = RoslynGenerationHelpers.GetFluentApiChainedInvocationExpression(
fluentApiInvocation,
"OnDelete",
new[] { $"global::Microsoft.EntityFrameworkCore.DeleteBehavior.NoAction" });

return SyntaxFactory.ExpressionStatement(fluentApiInvocation);
}

Expand Down Expand Up @@ -415,6 +420,11 @@ private StatementSyntax GetEfParentRelationshipInvocation(
"HasPrincipalKey",
new[] { $"principal => principal.Id" });

fluentApiInvocation = RoslynGenerationHelpers.GetFluentApiChainedInvocationExpression(
fluentApiInvocation,
"OnDelete",
new[] { $"global::Microsoft.EntityFrameworkCore.DeleteBehavior.NoAction" });

return SyntaxFactory.ExpressionStatement(fluentApiInvocation);
}

Expand Down

0 comments on commit f07e5df

Please sign in to comment.