aspnet/EntityFramework — pull request #1279 by ajcvickers (2014-12-12 18:01:30+00:00)
Title: Add higher-level AttachGraph methods

Currently two methods, with async overloads:
- AttachGraph: Adds each entity if its key value is not set, otherwise attaches the entity as Unchanged.
- UpdateGraph: Adds each entity if its key value is not set, otherwise attaches the entity as Modified.

We can discuss if both behaviors are needed, and if so whether it should be a single method with a flag.

These methods make use of an implementation of IEntityAttacher and there is a factory to get the IEntityAttacher to use for attach/update. This means that the defaults can be changed by registering a different factory in DI.

The default key checking is exposed as a IsKeySet property on EntityEntry, so it is easy to use this functionaliy either in the AttachGraph delegate or in implementations of IEntityAttacher.