Questions tagged [automapper-5]

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.

106 questions
0
votes
1 answer

How to configure and use automapper 5.1.1

I have been looking at this, trying to figure out how to get AutoMapper to work. This is what I had earlier public class DomainToViewModelMappingProfile: Profile { public DomainToViewModelMappingProfile() { Mapper.Initialize(cfg =>…
Tee-Jay
  • 736
  • 2
  • 9
  • 28
0
votes
1 answer

Automapper 5.1.1 Can't map Complex object, aways invalid

Here's my issue, I'm trying to map both this entities, and I aways get an exception: From: public int IdCorpoGestor { get; private set; } public string Nome { get; private set; } public string Email { get; private set; } public string…
Fals
  • 6,813
  • 4
  • 23
  • 43
0
votes
0 answers

Automapper one to one mapping

I have working solution, but a bit doubt if I made it correctly. I have base class from which derive 3 other classes Ad: public class Ad { public int Id { get; set; } public string Title { get; set; } public Address Address { get; set;…
Almat P
  • 1
  • 1
0
votes
1 answer

Auto mapper version 5 no definition for Mapper.Createmap

I'am currently following a tutorial of ASP.NET MVC in which instructor use auto mapper version 4.x and now i have only option of version 5. When I create a mapping profile in which i get an error Mapper does not contain a definition for…
0
votes
1 answer

Keeping source as a copy in destination class using Automapper

Is there a way to keep the entire source object as a copy in my destination class as a property.. e.g. Source: class SourceClass { prop string Prop1 { get; set; } prop string Prop2 { get; set; } } Destination: class DestinationClass { …
narcs
  • 213
  • 1
  • 2
  • 13
0
votes
1 answer

Issue while Automapper Upgrade to 5.1.1

We were using the automapper v5.0 in our code. In our create map statement, we had a statement -> m.ResolveUsing((src, o, context) => (CodeObject)context.Options.Items["test"])) When we upgraded the Automapper version to 5.1.1, we are getting build…
Silly John
  • 1,584
  • 2
  • 16
  • 34
0
votes
1 answer

AutoMapper issue - Missing type map configuration or unsupported mapping

I followed a tutorial on repository and unit of work pattern design, it includes AutoMapper as well and I have absolutely no experience with it. The tutorial was with a older version and I had to modify the AutoMapperConfiguration class and their…
Sugafree
  • 631
  • 2
  • 14
  • 30
0
votes
1 answer

AutoMapper 5.1.1 MethodAccessException on Windows Phone 8.1 (WinRT)

I have PCL where I using AutoMapper 5.1.1 with code: var mapperConfig = new MapperConfiguration(cfg => { cfg.AddProfile(); cfg.AddProfile(); ... }); var mapper = mapperConfig.CreateMapper(); Which working…
0
votes
1 answer

Why Automapper not working for base & inherited classes

In an MVC application, there is a Student class inherited from ApplicationUser base class (ASP.NET Identity) and there is a ViewModel of it called StudentViewModel as shown below: Entity Classes: public class ApplicationUser : IdentityUser
Jack
  • 1
  • 21
  • 118
  • 236
0
votes
1 answer

Is it possible with Automapper 5 to map from many properties into one list?

I am not native English so apologies if there is already duplicated question. I have a request class: class input { Car mainCar, List otherCars } to be mapped into: class mapped { List cars } with option like when mapping from…
Leszek P
  • 1,807
  • 17
  • 24
0
votes
1 answer

What is preventing my collections from being mapped with AutoMapper (5.x)?

This one is going to require a bit of code , so here it goes. Given the following code, why is the Case Insureds collection not being mapped to the Request Insureds collection? I've spent the better part of the morning trying to get this to…
Stephen Patten
  • 6,333
  • 10
  • 50
  • 84
0
votes
1 answer

Auto Mapper 5, no Ioc and Webforms

Now that AutoMapper is abolishing both the static API and the ability to change the mappings at runtime I have a problem with my WebForms application without an IoC manager. For the sake of this question take as given I cannot introduce an IoC…
TheEdge
  • 9,291
  • 15
  • 67
  • 135
0
votes
1 answer

Mapping Virtual Property Automapper

I have some problem with mapping models . So I have a entity model public class User { public string UserId { get; set;} public ICollection Groups {get; set;} } and DTO model public class UserInfo { public string UserId {…
Alexandr Sargsyan
  • 656
  • 1
  • 6
  • 21
0
votes
1 answer

map configuration or unsupported mapping

I have two types. One in the business layer: namespace Business { public class Car { private int _id; private string _make; private string _model; public int id { get { return _id; } …
w0051977
  • 15,099
  • 32
  • 152
  • 329
0
votes
1 answer

How do i map nested objects

public class SecurityAccess : IdentityUser { public string LName { get; set; } public string FName { get; set; } public string MName { get; set; } public DateTime NameDate { get; set; } public DateTime DOB { get; set; } …
Z3r0 C0oL
  • 165
  • 1
  • 1
  • 8