Skip to content

Commit 8c1bc0d

Browse files
Update text + add extensions
Update text + add extensions
1 parent 8ff568e commit 8c1bc0d

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

GraphDiff/GraphDiff/DbContextExtensions.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
}

GraphDiff/GraphDiff/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("3.0.1")]
35-
[assembly: AssemblyFileVersion("3.0.1")]
34+
[assembly: AssemblyVersion("3.0.2")]
35+
[assembly: AssemblyFileVersion("3.0.2")]

0 commit comments

Comments
 (0)