-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix BatchUpdate, BatchDelete Issue with Database First
Fix BatchUpdate, BatchDelete Issue with Database First
- Loading branch information
zzzprojects
committed
Jun 17, 2016
1 parent
06e52f7
commit f29d283
Showing
35 changed files
with
222 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Z.EntityFramework.Plus.EF5.NET40/_Internal/EF5_EF6/Database/GetEntityConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
#if FULL || BATCHDELETE || BATCHUPDATE | ||
#if EF5 || EF6 | ||
|
||
#if EF5 | ||
using System.Data.Common; | ||
using System.Data.Entity; | ||
using System.Data.Entity.Infrastructure; | ||
using System.Data.EntityClient; | ||
using System.Data.Objects; | ||
using System.Reflection; | ||
|
||
#elif EF6 | ||
using System.Data.Common; | ||
using System.Data.Entity; | ||
using System.Data.Entity.Core.EntityClient; | ||
using System.Data.Entity.Core.Objects; | ||
using System.Reflection; | ||
|
||
#endif | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
internal static partial class InternalExtensions | ||
{ | ||
public static EntityConnection GetEntityConnection(this Database @this) | ||
{ | ||
object internalContext = @this.GetType().GetField("_internalContext", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(@this); | ||
|
||
MethodInfo getObjectContext = internalContext.GetType().GetMethod("GetObjectContextWithoutDatabaseInitialization", BindingFlags.Public | BindingFlags.Instance); | ||
var objectContext = (ObjectContext)getObjectContext.Invoke(internalContext, null); | ||
DbConnection entityConnection = objectContext.Connection; | ||
|
||
return (EntityConnection)entityConnection; | ||
} | ||
} | ||
} | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Z.EntityFramework.Plus.EF5/_Internal/EF5_EF6/Database/GetEntityConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
#if FULL || BATCHDELETE || BATCHUPDATE | ||
#if EF5 || EF6 | ||
|
||
#if EF5 | ||
using System.Data.Common; | ||
using System.Data.Entity; | ||
using System.Data.Entity.Infrastructure; | ||
using System.Data.EntityClient; | ||
using System.Data.Objects; | ||
using System.Reflection; | ||
|
||
#elif EF6 | ||
using System.Data.Common; | ||
using System.Data.Entity; | ||
using System.Data.Entity.Core.EntityClient; | ||
using System.Data.Entity.Core.Objects; | ||
using System.Reflection; | ||
|
||
#endif | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
internal static partial class InternalExtensions | ||
{ | ||
public static EntityConnection GetEntityConnection(this Database @this) | ||
{ | ||
object internalContext = @this.GetType().GetField("_internalContext", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(@this); | ||
|
||
MethodInfo getObjectContext = internalContext.GetType().GetMethod("GetObjectContextWithoutDatabaseInitialization", BindingFlags.Public | BindingFlags.Instance); | ||
var objectContext = (ObjectContext)getObjectContext.Invoke(internalContext, null); | ||
DbConnection entityConnection = objectContext.Connection; | ||
|
||
return (EntityConnection)entityConnection; | ||
} | ||
} | ||
} | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Z.EntityFramework.Plus.EF6.NET40/_Internal/EF5_EF6/Database/GetEntityConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
#if FULL || BATCHDELETE || BATCHUPDATE | ||
#if EF5 || EF6 | ||
|
||
#if EF5 | ||
using System.Data.Common; | ||
using System.Data.Entity; | ||
using System.Data.Entity.Infrastructure; | ||
using System.Data.EntityClient; | ||
using System.Data.Objects; | ||
using System.Reflection; | ||
|
||
#elif EF6 | ||
using System.Data.Common; | ||
using System.Data.Entity; | ||
using System.Data.Entity.Core.EntityClient; | ||
using System.Data.Entity.Core.Objects; | ||
using System.Reflection; | ||
|
||
#endif | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
internal static partial class InternalExtensions | ||
{ | ||
public static EntityConnection GetEntityConnection(this Database @this) | ||
{ | ||
object internalContext = @this.GetType().GetField("_internalContext", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(@this); | ||
|
||
MethodInfo getObjectContext = internalContext.GetType().GetMethod("GetObjectContextWithoutDatabaseInitialization", BindingFlags.Public | BindingFlags.Instance); | ||
var objectContext = (ObjectContext)getObjectContext.Invoke(internalContext, null); | ||
DbConnection entityConnection = objectContext.Connection; | ||
|
||
return (EntityConnection)entityConnection; | ||
} | ||
} | ||
} | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.