@@ -21,7 +21,7 @@ public static class DbContextExtensions
2121 /// <param name="context">The database context to attach / detach.</param>
2222 /// <param name="entity">The root entity.</param>
2323 /// <param name="mapping">The mapping configuration to define the bounds of the graph</param>
24- /// <param name="allowDelete">NEED TEXTE!!!! </param>
24+ /// <param name="allowDelete">Allow to delete from graph. </param>
2525 /// <returns>The attached entity graph</returns>
2626 public static T UpdateGraph < T > ( this DbContext context , T entity ,
2727 Expression < Func < IUpdateConfiguration < T > , object > > mapping = null , bool allowDelete = true )
@@ -33,6 +33,20 @@ public static T UpdateGraph<T>(this DbContext context, T entity,
3333 return graphDiffer . Merge ( context , entity ) ;
3434 }
3535
36+ /// <summary>
37+ /// Merges a graph of entities with the data store.
38+ /// </summary>
39+ /// <typeparam name="T">The type of the root entity</typeparam>
40+ /// <param name="context">The database context to attach / detach.</param>
41+ /// <param name="entity">The root entity.</param>
42+ /// <param name="allowDelete">Allow to delete from graph.</param>
43+ /// <returns>The attached entity graph</returns>
44+ public static T UpdateGraph < T > ( this DbContext context , T entity , bool allowDelete )
45+ where T : class , new ( )
46+ {
47+ return context . UpdateGraph ( entity , null , allowDelete ) ;
48+ }
49+
3650 // TODO add IEnumerable<T> entities
3751 }
3852}
0 commit comments