Comments (13)
I didn't think EF6 supported NetCore, does it? It's .NET 4.5 only.
from automapper.ef6.
Strike that, .NET 4.0 and .NET 4.5. What EF are you using?
from automapper.ef6.
I'm using EF Core, but this had been working. Here's the scenario:
I have an ASP.NET Core project (created prior to the 1.0 release) that was using AutoMapper 5.0.0-beta-1 and AutoMapper.EF6 0.3.0. Everything worked as expected. I've since upgraded that project to .NET Core 1.0 release and updated to AutoMapper 5.0.0. I can't use any of the AutoMapper.EF6 versions now since they don't support the netcoreapp1.0 profile.
I tried to see if I could get a version compiling against that profile, but the DelegateDecompiler.EntityFramework dependency is very old and doesn't currently support any of the .NET Core stuff. (It was last updated about 6 months ago.)
If this is intended only for EF6 and not EF Core, is there a similar package for EF Core?
from automapper.ef6.
It had been working? Maybe when EF Core was EF7, but I never had a package working with EF Core.
The problem with Delegate Decompiler is it relies on reflection tools that are currently ONLY available to full .NET Framework. The APIs simply do not exist in .NET Core, neither do the capabilities.
from automapper.ef6.
Yes, it had been working. :) Keep in mind, though, that this was prior to the change to using netcoreapp1.0 as the moniker, so that may have had something to do with it.
I saw that issue with Delegate Decompiler as well, which prevents it from being used at all.
In the meantime (only tested with a couple of methods), it seems like I can create a workaround by doing this:
public static class EntityFrameworkExtensions
{
public static async Task<List<TDestination>> ProjectToListAsync<TDestination>(this IQueryable queryable, IConfigurationProvider config)
{
return await queryable.ProjectTo<TDestination>(config).ToListAsync();
}
public static async Task<TDestination> ProjectToSingleOrDefaultAsync<TDestination>(this IQueryable queryable, IConfigurationProvider config)
{
return await queryable.ProjectTo<TDestination>(config).SingleOrDefaultAsync();
}
public static TDestination ProjectToSingleOrDefault<TDestination>(this IQueryable queryable, IConfigurationProvider config)
{
return queryable.ProjectTo<TDestination>(config).SingleOrDefault();
}
public static List<TDestination> ProjectToList<TDestination>(this IQueryable queryable, IConfigurationProvider config)
{
return queryable.ProjectTo<TDestination>(config).ToList();
}
}
I've been able to test both the async and the non-async versions and they both seem to work. Not sure if there might be any potential issues with that approach though.
from automapper.ef6.
One way to get this to work would be to only support net451 (which EF Core does support) and not netstandard1.3, its other target.
from automapper.ef6.
Also, the delegate decompiler stuff works with .NET 4.5. So if you didn't want to run on .NET Core, you're set.
Which, if you are.....good luck buddy :)
from automapper.ef6.
One last thing, the delegate decompiler EF extension was for async, which doesn't sound like it should be used ATM dotnet/efcore#5816 so I could create and EF core version that uses delegate decompile and targets .NET 4.5.1. Thoughts? It's such a silly little library though, just extension methods.
from automapper.ef6.
Yea, it's probably not worth the effort. Do you see anything wrong with the extension methods I showed in this comment? The two (only because those were the two I was previously using) I've tested so far seem to work correctly.
from automapper.ef6.
Nope. The extension methods were pretty simple, just stuff we copied and pasted around.
from automapper.ef6.
Cool. I'll add the rest of them in so I can keep using them.
from automapper.ef6.
Having read through this issue; am I correct that if you used EF core in a 4.5/4.6.1 [not .net core] app then the automapper.EF6 lib will probably work?
from automapper.ef6.
Worth a shot, but the underlying dependency I have is on EF6 not EF Core
On Wednesday, October 5, 2016, Darcy [email protected] wrote:
Having read through this issue; am I correct that if you used EF core in a
4.5/4.6.1 [not .net core] app then the automapper.EF6 lib will probably
work?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGYMp2wI8xqjt-N-WAnyLGWSAb6ouDgks5qxHOYgaJpZM4JDGTN
.
from automapper.ef6.
Related Issues (20)
- ProjectTo(): int <-> Color conversion leads into System.ArgumentException HOT 3
- Strongly signed HOT 1
- EntityFramework Version HOT 2
- Package version 1.0.0 on NuGet appears broken HOT 7
- EF Core 2.0 Support HOT 5
- Is is planned to release this with support for EF Core? HOT 1
- DLLs in NuGet packages appear not to be signed HOT 1
- Nuget version depends on incorrect Automapper dll HOT 4
- Can't use IValueConverter HOT 1
- Support NETCOREAPP3.1 or NETSTANDARD2.1 HOT 3
- [Question] Can I use AutoMapper.EF to map Dtos to entities (including nested included relations)? HOT 1
- how to use? HOT 2
- Nuget package targets outdated HOT 3
- Add Ctor for GenerateEntityFrameworkPrimaryKeyPropertyMaps that takes in an instance of the DBContent HOT 1
- State of 2.1.0 HOT 3
- error in Linq handling for ProjectTo method HOT 1
- Default value on "...OrDefault" operations HOT 1
- Possibility to update System.Data.SqlClient to version >=4.8.5? HOT 1
- Incompatible with AutoMapper v6.0.0.0 HOT 1
- Pass MapperConfigurationExpression? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automapper.ef6.