Skip to content

Commit

Permalink
Fix Cascade.DeleteOrphan (#474)
Browse files Browse the repository at this point in the history
+semver:fix
  • Loading branch information
hazzik committed Oct 9, 2020
1 parent e7edaba commit 3b66ce6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void Refresh_should_add_the_correct_cascade_attribute_to_the_parent_part(
[Test]
public void DeleteOrphans_should_add_the_correct_cascade_attribute_to_the_parent_part()
{
A_call_to(_cascade.DeleteOrphans).should_set_the_cascade_value_to("delete-orphans");
A_call_to(_cascade.DeleteOrphan).should_set_the_cascade_value_to("delete-orphan");
}

[Test]
Expand Down
11 changes: 10 additions & 1 deletion src/FluentNHibernate/Mapping/CascadeExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,18 @@ public TParent Refresh()
/// <summary>
/// Cascade deletes orphans
/// </summary>
[Obsolete("Please use DeleteOrphan instead")]
public TParent DeleteOrphans()
{
setter("delete-orphans");
return DeleteOrphan();
}

/// <summary>
/// Cascade deletes orphans
/// </summary>
public TParent DeleteOrphan()
{
setter("delete-orphan");
return parent;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public CollectionCascadeExpression(TParent parent, Action<string> setter)
/// <summary>
/// Cascade deletes, deleting any orphaned records
/// </summary>
public TParent DeleteOrphan()
public new TParent DeleteOrphan()
{
setter("delete-orphan");
return parent;
Expand Down

0 comments on commit 3b66ce6

Please sign in to comment.