| 123456789101112131415161718192021222324252627 |
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.ChangeTracking;
- namespace VberZero.EntityHistory.Extensions;
- internal static class PropertyEntryExtensions
- {
- internal static object GetNewValue(this PropertyEntry propertyEntry)
- {
- if (propertyEntry.EntityEntry.State == EntityState.Deleted)
- {
- return null;
- }
- return propertyEntry.CurrentValue;
- }
- internal static object GetOriginalValue(this PropertyEntry propertyEntry)
- {
- if (propertyEntry.EntityEntry.State == EntityState.Added)
- {
- return null;
- }
- return propertyEntry.OriginalValue;
- }
- }
|