Skip to content

Commit

Permalink
Fix EFCore build
Browse files Browse the repository at this point in the history
  • Loading branch information
rayao committed Jul 25, 2016
1 parent a2173ff commit b83b399
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ private static async Task PrepareEntry<TEntity>(
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));

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)
{
Expand Down

0 comments on commit b83b399

Please sign in to comment.