Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support EF Code First for EntityTableDataLoader
Add support EF Code First for EntityTableDataLoader
- Loading branch information
zzzprojects
committed
Mar 12, 2018
1 parent
2305b30
commit 45b0105
Showing
14 changed files
with
52 additions
and
30 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
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="EntityFramework" version="6.1.2" targetFramework="net45" /> | ||
<package id="NMemory" version="1.1.2" targetFramework="net45" /> | ||
</packages> |
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
27 changes: 27 additions & 0 deletions
27
Main/Source/Effort/Internal/Extensions/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,27 @@ | ||
#if !EFOLD | ||
|
||
using System.Data.Entity; | ||
using System.Data.Entity.Core.EntityClient; | ||
using System.Data.Entity.Core.Objects; | ||
using System.Reflection; | ||
|
||
namespace Effort.Internal | ||
{ | ||
internal static class InternalExtensions | ||
{ | ||
internal static EntityConnection GetEntityConnection(this Database database) | ||
{ | ||
var internalContext = database.GetType().GetField("_internalContext", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(database); | ||
|
||
var getObjectContext = internalContext.GetType().GetMethod("GetObjectContextWithoutDatabaseInitialization", BindingFlags.Public | BindingFlags.Instance); | ||
|
||
var objectContext = (ObjectContext) getObjectContext.Invoke(internalContext, null); | ||
|
||
var entityConnection = objectContext.Connection; | ||
|
||
return (EntityConnection) entityConnection; | ||
} | ||
} | ||
} | ||
|
||
#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