Skip to content

Commit 72b9e1b

Browse files
druidroadfredericDelaporte
authored andcommitted
Handle both object instance and identifier passed to the "old" parameter of ManyToOneType.IsModified (#1499)
* Fixes #1496
1 parent 82ded5d commit 72b9e1b

File tree

8 files changed

+1102
-2
lines changed

8 files changed

+1102
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System.Collections.Generic;
12+
using NHibernate.Event;
13+
14+
namespace NHibernate.Test.NHSpecificTest.GH1496
15+
{
16+
using System.Threading.Tasks;
17+
using System.Threading;
18+
public partial class AuditEventListener : IPostUpdateEventListener
19+
{
20+
21+
public async Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
22+
{
23+
if (isActive == false)
24+
{ return; }
25+
26+
var modifiedItems = await (@event.Persister.FindModifiedAsync(@event.OldState, @event.State, @event.Entity, @event.Session, cancellationToken));
27+
foreach (int index in modifiedItems)
28+
{
29+
ModifiedItems.Add(new Item
30+
{
31+
Index = index,
32+
OldState = @event.OldState[index],
33+
State = @event.State[index]
34+
});
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)