Skip to content

Commit 1898231

Browse files
committed
Renamed EntityBag to items
1 parent 018e2c8 commit 1898231

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/EntityFrameworkCore.Triggered.Abstractions/ITriggerContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public interface ITriggerContext<out TEntity>
1414
/// <summary>
1515
/// Gets or sets a key/value collection that can be used to share data within the scope of this Entity
1616
/// </summary>
17-
IDictionary<object, object> EntityBag { get; }
17+
IDictionary<object, object> Items { get; }
1818
}
1919
}

src/EntityFrameworkCore.Triggered/TriggerContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public TEntity? UnmodifiedEntity
4444
}
4545
}
4646

47-
public IDictionary<object, object> EntityBag => _entityBagStateManager.GetForEntity(_entity);
47+
public IDictionary<object, object> Items => _entityBagStateManager.GetForEntity(_entity);
4848
}
4949
}

test/EntityFrameworkCore.Triggered.IntegrationTests/EntityBags/Triggers/SoftDeleteTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public Task BeforeSave(ITriggerContext<User> context, CancellationToken cancella
2222
{
2323
if (context.ChangeType is ChangeType.Deleted)
2424
{
25-
context.EntityBag[IsSoftDeleted] = true;
25+
context.Items[IsSoftDeleted] = true;
2626
context.Entity.DeletedOn = DateTime.UtcNow;
2727

2828
_dbContext.Entry(context.Entity).State = Microsoft.EntityFrameworkCore.EntityState.Modified;

test/EntityFrameworkCore.Triggered.IntegrationTests/EntityBags/Triggers/StampModifiedOnTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public Task BeforeSave(ITriggerContext<User> context, CancellationToken cancella
1313
{
1414
if (context.ChangeType is ChangeType.Modified)
1515
{
16-
if (!context.EntityBag.ContainsKey(SoftDeleteTrigger.IsSoftDeleted))
16+
if (!context.Items.ContainsKey(SoftDeleteTrigger.IsSoftDeleted))
1717
{
1818
context.Entity.ModifiedOn = DateTime.UtcNow;
1919
}

test/EntityFrameworkCore.Triggered.Tests/Stubs/TriggerContextStub.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ public class TriggerContextStub<TEntity> : ITriggerContext<TEntity>
99
public ChangeType ChangeType { get; set; }
1010
public TEntity Entity { get; set; }
1111
public TEntity UnmodifiedEntity { get; set; }
12-
public IDictionary<object, object> EntityBag { get; set; }
12+
public IDictionary<object, object> Items { get; set; }
1313
}
1414
}

test/EntityFrameworkCore.Triggered.Tests/TriggerContextTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ public void EntityBag_ConsistentlyReturnsTheSameInstance()
113113
var sample1 = new TestModel();
114114
var subject = new TriggerContext<object>(dbContext.Entry(sample1).Entity, dbContext.Entry(sample1).OriginalValues, ChangeType.Modified, new());
115115

116-
var expectedInstance = subject.EntityBag;
117-
Assert.Equal(expectedInstance, subject.EntityBag);
116+
var expectedInstance = subject.Items;
117+
Assert.Equal(expectedInstance, subject.Items);
118118
}
119119
}
120120
}

test/EntityFrameworkCore.Triggered.Transactions.Tests/Stubs/TriggerContextStub.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ public class TriggerContextStub<TEntity> : ITriggerContext<TEntity>
88
public ChangeType ChangeType { get; set; }
99
public TEntity Entity { get; set; }
1010
public TEntity UnmodifiedEntity { get; set; }
11-
public IDictionary<object, object> EntityBag { get; set; }
11+
public IDictionary<object, object> Items { get; set; }
1212
}
1313
}

0 commit comments

Comments
 (0)