Extensions for AutoMapper and EF6
Перейти к файлу
MagicAndre1981 820808137b
Update EF to 6.5.1 to get a newer System.Data.SqlClient version (#36)
* update DelegateDecompiler.EntityFramework to version 0.34.0

* update EntityFramework to version 6.5.1 ( https://erikej.github.io/ef6/dotnet/2024/05/16/ef6-whatsnew.html )
2024-08-19 09:26:43 +03:00
.github/workflows Implement CI/Release flow similar to base package (#31) 2021-07-16 13:46:46 +03:00
src/AutoMapper.EF6 Update EF to 6.5.1 to get a newer System.Data.SqlClient version (#36) 2024-08-19 09:26:43 +03:00
.gitignore EF6 extensions 2015-07-07 11:13:41 -05:00
AutoMapper.EF6.sln Marking 1.1 2017-10-31 07:37:01 -05:00
Build.ps1 exec { & dotnet test -c Release -l trx --verbosity=normal } 2023-01-15 17:31:38 +02:00
LICENSE Initial commit 2015-07-06 15:58:07 -05:00
NuGet.config AutoMapper 8.0 support 2018-11-19 18:26:15 +02:00
Push.ps1 Implement CI/Release flow similar to base package (#31) 2021-07-16 13:46:46 +03:00
README.md Update README.md 2020-12-03 17:08:00 +02:00

README.md

AutoMapper.EF6

Extensions for AutoMapper and EF6

NuGet MyGet

This contains some useful extensions I've used with AutoMapper and EF6. Instead of this:

Mapper.CreateMap<Employee, EmployeeDto>()
  .ForMember(d => d.FullName, opt => opt.MapFrom(src => src.FirstName + " " + src.LastName));

var employees = await db.Employees.ProjectTo<EmployeeDto>().ToListAsync();

You can do this instead:

public class Employee {
  [Computed]
  public string FullName { get { return FirstName + " " + LastName; } }
}
Mapper.CreateMap<Employee, EmployeeDto>();

var employees = await db.Employees.ProjectToListAsync<EmployeeDto>();

This package wraps up calling ProjectTo, the DelegateDecompiler Decompile/DecompileAsync methods, and then the LINQ methods to execute the queryable (ToList, ToArray, Single, SingleOrDefault etc).