-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Dapper.EntityFramework package setup #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you indicate what library version (dapper / dapper.ef) and target On 23 Jul 2016 7:22 a.m., "Dan J" [email protected] wrote:
|
1.50.2 dapper, 1.5.0 dapper.ef, and my project is targeting .NET 4.6.1 |
First, you need to make sure you have the types installed locally - they are not installed by default, and are available from Microsoft here as "Microsoft® System CLR Types for Microsoft® SQL Server® 2012": https://www.microsoft.com/en-gb/download/details.aspx?id=29065 - note that there are separate installers for x86 and x64. Next thing you need is the EF pieces of Dapper; there was a problem in the System.Runtime reference in 1.50.0, so I've fixed this and deployed as 1.50.2; so you need:
(or via https://www.nuget.org/packages/dapper.entityframework - note that strong-named versions are also available) Next, you also need an assembly-binding redirect, because MS ships v11, but EF asks for v10. In your app.config / web.config, under
And finally, you need to tell dapper "core" about EF:
With that all in place: it should work fine; sorry there are a few steps, but almost all of them are due to MS, not me!
Let me know how you get on! |
Working! I worked around the Runtime by manually adding the facade before I tried installing it, and I already had the types installed with redirect, so it must have been the handler registrations. For some reason I thought that was just magicked into the wrapper. Thanks! |
Is there something I need to do to use DbGeography types with the entity framework package? I installed the package, but by queries keep returning an empty DbGeography object (all properties are null).
The text was updated successfully, but these errors were encountered: