Merge pull request #16989 from abpframework/auto-merge/rel-7-0/2040

pull/16990/head
maliming 2 years ago committed by GitHub
commit ff03e28ec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,14 +19,7 @@ public static class UnitOfWorkExtensions
{
Check.NotNull(unitOfWork, nameof(unitOfWork));
if (!unitOfWork.Items.ContainsKey(key))
{
unitOfWork.Items[key] = value;
}
else
{
unitOfWork.Items.Add(key, value);
}
unitOfWork.Items[key] = value;
}
public static TValue GetItemOrDefault<TValue>([NotNull] this IUnitOfWork unitOfWork, string key)

@ -21,6 +21,11 @@ public class UnitOfWorkExtensions_Tests : AbpIntegratedTest<AbpUnitOfWorkModule>
uow.Items.ShouldContainKey("testKey");
uow.Items.ContainsValue("testValue");
uow.AddItem("testKey", "testValue2");
uow.Items.ShouldContainKey("testKey");
uow.Items.ContainsValue("testValue2");
}
[Fact]

Loading…
Cancel
Save