diff --git a/src/Microsoft.Restier.Providers.EntityFramework7/Submit/ChangeSetInitializer.cs b/src/Microsoft.Restier.Providers.EntityFramework7/Submit/ChangeSetInitializer.cs index c77bfb4b..8defe50b 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework7/Submit/ChangeSetInitializer.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework7/Submit/ChangeSetInitializer.cs @@ -71,7 +71,7 @@ private static async Task PrepareEntry( Type entityType = typeof(TEntity); TEntity entity; - if (entry.IsNewRequest) + if (entry.DataModificationItemAction == DataModificationItemAction.Insert) { // TODO: See if Create method is in DbSet<> in future EF7 releases, as the one EF6 has. entity = (TEntity)Activator.CreateInstance(typeof(TEntity)); @@ -79,12 +79,12 @@ private static async Task PrepareEntry( ChangeSetInitializer.SetValues(entity, entityType, entry.LocalValues); set.Add(entity); } - else if (entry.IsDeleteRequest) + else if (entry.DataModificationItemAction == DataModificationItemAction.Remove) { entity = (TEntity)await ChangeSetInitializer.FindEntity(context, entry, cancellationToken); set.Remove(entity); } - else if (entry.IsUpdateRequest) + else if (entry.DataModificationItemAction == DataModificationItemAction.Update) { if (entry.IsFullReplaceUpdateRequest) {