Skip to content

Repository files navigation

AutoMapper.EF6

Extensions for AutoMapper and EF6

NuGetMyGet

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));varemployees=awaitdb.Employees.ProjectTo<EmployeeDto>().ToListAsync();

You can do this instead:

publicclassEmployee{[Computed]publicstringFullName{get{returnFirstName+" "+LastName;}}}Mapper.CreateMap<Employee,EmployeeDto>();varemployees=awaitdb.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).

About

Extensions for AutoMapper and EF6

Resources

Stars

222 stars

Watchers

24 watching

Forks

Releases

Packages

Used by

Contributors

Languages