Questions tagged [automapper-6]

Use this tag for version specific questions about AutoMapper 6 - the convention-based object-to-object mapper and transformer library for .NET. When using this tag also include the more generic [automapper] tag where possible.

117 questions
0
votes
2 answers

Create Default Value For Expression[] In Runtime By Knowing the Type Only

i want to call ProjectTo dynamically for example on this overload: public static IQueryable ProjectTo(this IQueryable source, params Expression>[] membersToExpand); like…
HaMEd
  • 43
  • 1
  • 8
0
votes
2 answers

C# AutoMapper with Entity Framework - Works with List but not single nullable instance

I have a very wierd error that I can't get my head around. I'm using AutoMapper 6 with AutoMapper.Collection and AutoMapper.Collection.EntityFramework. https://github.com/AutoMapper/AutoMapper.Collection As you can see from the screenshot below,…
Ogglas
  • 62,132
  • 37
  • 328
  • 418
0
votes
1 answer

Automapper Dependencies not resolved in .Net Core

I want to add reference in my project Automapper as i am migrating from EF6 to Ef Core. So i need to add automapper which i had used. When i try to add from package console it get successfully installed but actually it is not as i can see at the…
Rahul
  • 427
  • 4
  • 20
0
votes
1 answer

Mapping properties that are collection types

Say I have a classes like this in a business layer: Namespace Business { public class Order { public int ID { get; set; } public List OrderItems { get; set; } } public class OrderItem { public int ID…
w0051977
  • 15,099
  • 32
  • 152
  • 329
0
votes
1 answer

Map List of Customers with automapper

Using Automapper I am trying to map one object to another. One property is a class called Task containing a list of customers. The other class is called Result and contains a count of customers as well as another list of customers. This is my…
Uke
  • 169
  • 3
  • 21
0
votes
1 answer

AutoMapper Ignore not working on entity update

I Know this question was answered in another thread. And I tried what was suggested but it still not working. Here is my entity and model mapping... cfg.CreateMap() .ForMember(d =>…
type.parse
  • 21
  • 7
0
votes
1 answer

AutoMapper 6 - How can I create a mapping that ignore and map a list of object

I'm a little newbie on AutoMapper, I don't find almost nothing about v6.0 on Stackoverflow and Github. I need help on this problem I have this two Entities: public class DocFinanceiro { public int AutoId { get; set; } public virtual…
0
votes
1 answer

AutoMapper generates exception

I am using AutoMapper 6.0.2 in a .NET EF project and I can't seem to get AutoMapper to work. In a tutorial that was using AutoMapper 4.x.x this was used: class A { string Id; string Name; B test {get; set;} } class B { string Id; …
0
votes
1 answer

AutoMapper tiny class to large class with validation

I have a large class with 30+ properties, and I need to map to it from a tiny class with about 6 properties that should map automatically (same name, same Type). I do not want to have to maintain a list of 24+ .Ignore()s in the mapping config, but…
pbristow
  • 1,997
  • 4
  • 26
  • 46
-1
votes
1 answer

Automapper not mapping on ICollection

My automapper configuration public AutoMapperProfile() { CreateMap().ReverseMap(); CreateMap().ReverseMap(); …
-1
votes
1 answer

Using Automapper with dependency injection in service to transfer from a source project to a target project

I’m using Automapper for the first time in a .net core project that uses dependency injection to transfer data from from an old legacy database to a new microservice architecture, with each microservice connecting to it’s own database (using DDD…
-1
votes
1 answer

Automapper map recursive menu tree

I followed the instructions on https://www.mikesdotnetting.com/article/255/entity-framework-recipe-hierarchical-data-management Now I'm trying to map my entities to my dtos which is constantly failing. I saw many issues releated to this but none…
jonny
  • 24
  • 4
1 2 3 4 5 6 7
8