NeatMapper.EntityFrameworkCore
3.1.0
See the version list below for details.
dotnet add package NeatMapper.EntityFrameworkCore --version 3.1.0
NuGet\Install-Package NeatMapper.EntityFrameworkCore -Version 3.1.0
<PackageReference Include="NeatMapper.EntityFrameworkCore" Version="3.1.0" />
paket add NeatMapper.EntityFrameworkCore --version 3.1.0
#r "nuget: NeatMapper.EntityFrameworkCore, 3.1.0"
// Install NeatMapper.EntityFrameworkCore as a Cake Addin #addin nuget:?package=NeatMapper.EntityFrameworkCore&version=3.1.0 // Install NeatMapper.EntityFrameworkCore as a Cake Tool #tool nuget:?package=NeatMapper.EntityFrameworkCore&version=3.1.0
.NEaT Mapper - Entity Framework Core
What is this package
Entity Framework Core maps for NeatMapper.
Creates automatic maps and projections between entities and their keys (even composite and shadow keys), supports normal maps and asynchronous ones, also supports collections (not nested).
How to install
You can find all the other packages on Nuget https://www.nuget.org/profiles/xriuk
You can install this package directly from Nuget https://www.nuget.org/packages/NeatMapper.EntityFrameworkCore
How to use
While configuring your services simply add
services.AddDbContext<TestContext>();
services.AddNeatMapper();
services.AddNeatMapperEntityFrameworkCore<TestContext>();
And you are ready to map your entities
var mapper = serviceProvider.GetRequiredService<IMapper>();
var asyncMapper = serviceProvider.GetRequiredService<IMapper>();
var projector = serviceProvider.GetRequiredService<IProjector>();
// Map a key to its entity
var entity = mapper.Map<MyEntity>(2);
var entity = await asyncMapper.MapAsync<MyEntity>(2);
// Map a composite key to an entity with tuples (System.Tuple or System.ValueTuple),
// notice the double parentheses
var entity = await asyncMapper.MapAsync<MyEntityWithCompositeKey>((2, "StringKey"));
// Map multiple keys to their respective entities
var entities = await asyncMapper.MapAsync<MyEntity[]>(new int[]{ 2, 3, ... });
// Map an entity to its key(s)
(int MyIntKey, string MyStringKey) = mapper.Map<(int, string)>(myEntity);
// Project an entity into its key
var myEntitiesKeys = db.Set<MyEntity>()
.Project<int>(projector)
.ToArray();
Advanced options
Find more advanced use cases in the website or in the extended tests project.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- Microsoft.EntityFrameworkCore (>= 3.1.0 && < 4.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
.NETFramework 4.7
- Microsoft.EntityFrameworkCore (>= 3.1.0 && < 4.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
.NETFramework 4.8
- Microsoft.EntityFrameworkCore (>= 3.1.0 && < 4.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
.NETStandard 2.1
- Microsoft.EntityFrameworkCore (>= 5.0.0 && < 6.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
net5.0
- Microsoft.EntityFrameworkCore (>= 5.0.0 && < 6.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
net6.0
- Microsoft.EntityFrameworkCore (>= 6.0.0 && < 8.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
net7.0
- Microsoft.EntityFrameworkCore (>= 6.0.0 && < 8.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.0 && < 9.0.0)
- NeatMapper (>= 3.1.0 && < 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See full changelog at https://www.neatmapper.org/ef-core/changelog#310---2024-04-26