Use this tag for version specific questions about AutoMapper 5 - 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.
Questions tagged [automapper-5]
106 questions
1
vote
1 answer
Automapper v5.1.1 - Circular references
I know this might be flagged as a duplicate question, and yes, I did review the questions that may already have answered my question, but still couldn't find an answer.
As most of the other questions relate to, my issue is related to models that…

Richard Bailey
- 2,658
- 4
- 27
- 45
1
vote
1 answer
Rewrite code for Automapper v5.0 to v4.0
Automapper v4.0 was very straight forward to use within a method, can someone help rewrite this for v5.0 please (specifically the Mapper code):
public IEnumerable GetNewNotifications()
{
var userId =…

Reza
- 5,314
- 5
- 21
- 35
0
votes
1 answer
Back word compatible with new added member
I am adding a new data member in a class which is part of shared nuget package. On Server application, I need to support both nuget packages, previous nuget package member does not have newly added member. How do I map this member so my code does…

Nainesh Patel
- 488
- 2
- 5
- 19
0
votes
1 answer
Map a 2nd level nested list property to first level list property with automapper
I need your help. I have basic experience with automapper and it all works great, but in one way or another i can't map my next change in the source object to my destination object.
Let me explain it a bit:
In IUser, i added a property…

mkeymolen
- 196
- 1
- 3
- 14
0
votes
0 answers
Mapping objects with item in source to list of items in the destination and RowVersion in the destination
I have several hours trying to map between the following types:
Source Type:
public class PatientModel : IPatientModel
{
public int Id { get; set; }
public int? PatientNumber { get; set; }
public string FirstName {…

Anas Tina
- 329
- 1
- 2
- 14
0
votes
1 answer
AutoMapper ConvertUsing is not being called
I want to transform two properties of base classes using ConvertUsing, but it is not being called
Base classes
public abstract class BaseDadoMestreViewModel
{
public DateTime UltimaAtualizacao { get; set; }
public bool Excluido { get; set;…

Marcelo
- 1
- 1
0
votes
0 answers
How to reomove cirular refernce when automapped domain classes and custom model?
I am using autommapper to convert domain class to custom Model in asp.net, the problem is that automapper creates circular
refernces with child objects,how can i remove circular refernces?
var config = new MapperConfiguration(cfg =>
…

Ali
- 417
- 1
- 6
- 16
0
votes
0 answers
Automapper - Conditional List Mapping
I have the following Lists. I want to map the attributesList to the fieldsList list but I only want to update the Value property in the fieldsList where the Name values are equal. All the other properties in the fieldsList should be ignored - I've…

adam78
- 9,668
- 24
- 96
- 207
0
votes
1 answer
auto mapping properties from two classes with third class using automapper
I have two classes, say ClassA and ClassB, and I want to map them with ClassC. How can I do it?
ClassA has only 1 property and ClassB has 5 properties. ClassC has 6 properties.
Situation is something as below:
Public ClassC MapRequest(classA id,…

Kapil Garg
- 51
- 1
- 4
0
votes
0 answers
Automapper Circular Reference
I have two objects
class Order{ public List Cases {get;set;} }
class Case { public Order Order {get;set;}
I map them using Automapper 5.2.0
CreateMap().PreserveReferences()
.ForMember(d=>d.Case,…

nelly2k
- 781
- 1
- 10
- 28
0
votes
0 answers
AutoMapper 5.2 Error and Mvc Web de Dto a MV
I have a mvc project with a wcf and I am trying to automapper 5.2 passing from DTO to ViewModel of views and gives me the following error.
AutoMapperConfiguration.cs
public class AutoMapperConfiguration
{
public static void Configure()
…

ascariz
- 13
- 1
- 4
0
votes
1 answer
How to use CreateMissingTypeMaps option and manual mappings with EF Proxy Classes?
I have a situation that requires to use CreateMissingTypeMaps and manual mappings at the "same time" (or at least at the same configuration).
Scenario: The Domain and View Model classes are manually mapped using profiles. The CreateMissingTypeMaps…

Douglas Gandini
- 827
- 10
- 24
0
votes
0 answers
Automapper 5, Problems mapping expressions
I have a simple data reader class to read 'CspUsageDetails_Live' entities from my database. These are mapped to and from CspUsageDetailImportDto models using auto mapper.
The reader class has a method called Get that takes an expression…

Kieran
- 186
- 2
- 13
0
votes
1 answer
How to use Automapper 5?
I am new to Automapper. With below links, I am trying to understand it in action.
http://automapper.org/
https://lostechies.com/jimmybogard/2016/01/21/removing-the-static-api-from-automapper/
I am using its Automapper v 5.2.0
Here is my…

Kgn-web
- 7,047
- 24
- 95
- 161
0
votes
1 answer
Bootstrapping AutoMapper & StructureMap via ConstructServicesUsing
How to tell AutoMapper 5 to use StructureMap for constructing services without creating a bootstrapping problem, i.e. new MapperConfiguration(cfg => cfg.ConstructServicesUsing(some_IContainer)) when the config is being made via StructureMap?
Custom…

Petrus Theron
- 27,855
- 36
- 153
- 287