Questions tagged [automapper-3]

Use this tag for version specific questions about AutoMapper 3 - 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.

This release was focussed on a separation for platform deployments, code comments and LINQ projection. Release blog and notes give further details.

128 questions
2
votes
1 answer

Exception throws on CreateMap

Hi I am trying to add AutoMapper into my app but I seem to have some problems with it in th eintegrationg.HEre is it what I have so far. In order to not create a direct dependency to Automapper I have created a simple maping for it's most basic…
aleczandru
  • 5,319
  • 15
  • 62
  • 112
1
vote
0 answers

Expression 'dest => dest.Request.ID' must resolve to top-level member and not any child object's properties

I want to know why we will get this error and how to resolve it without creating seperating mapping for individual classes. I have two classes which I want to automap. I have followed the same approach for other two classes and it is being mapped…
1
vote
0 answers

How does AutoMapper store all its maps in memory?

I wanted to know how AutoMapper stores all its MappingConfigurations in memory. Also how can I remove all the mappings from memory without using Mapper.Reset. I am using AutoMapper 3.2.1
Sharthak Ghosh
  • 576
  • 1
  • 9
  • 22
1
vote
1 answer

AutoMapper: class properties, map ISet to HashSet
I have defined a mapping to/from my DTO object, the properties on one versus the other match excatly except that the DTO Object has collections defined as ISet and the non DTO object has those collectiond defined as HashSet . I've noticed a…
Greg Mone
  • 11
  • 5
1
vote
1 answer

How can i map a child object with AutoMapper?

I am not sure if i am over thinking this or not, but i cannot sus this out. I have a parent object here called Template public Template() { public long Id { get; set; } public Scoring SubProperty { get; set; } } Here is my Scoring object…
Gillardo
  • 9,518
  • 18
  • 73
  • 141
1
vote
2 answers

AutoMapper hurting performance in .net application having more than 1327 DTO while mapping

We are using AutoMapper 3.1.1.0 in our Dot net application. We are having lots of classes which neeed to map. Time required to initialize mapping is almost 22 seconds. We are having almost 1327 DTO which need to mapped. And we can say that each…
DevPerson
  • 399
  • 1
  • 6
  • 21
1
vote
2 answers

Merge - Mapping with AutoMapper

I'm facing an issue with casting in AutoMapper. Following are details. Here is my source class public class FamilyModel { public int FamilyID { get; set; } public string FamilyName { get; set; } } And here is my destination class public…
Hetal
  • 631
  • 1
  • 7
  • 19
1
vote
1 answer

Architecture to use Automapper with database first approach

I have the following Solution structure. Solution ProductServiceApi Business DataAccess DTO Contract I am using EntityFramework in DataAccess layer. It has the .edmx file and entity classes(e.g. Product). I have my domain classes in DTO…
1
vote
2 answers

AutoMapper incorrectly maps property with name Type - how to handle for multiple classes

While maping objects with AutoMapper, we realized that if there is a property named Type in a class, and no explicit mapping has been defined, AutoMapper maps that property to the Type name of the source type! To demonstrate, let's say I have…
Arghya C
  • 9,805
  • 2
  • 47
  • 66
1
vote
3 answers

KendoGridBinderEx - No property or field exists in type

I am using AngularJS along with KendoUI to create a grid, which gets its data from a WebAPI webservice. For the grid, I want to allow server-side sorting, paging, filtering, and grouping. For this purpose, I am trying to use the KendoGridBinderEx…
RebelScum
  • 549
  • 2
  • 5
  • 19
1
vote
2 answers

Why does Automapper map a concrete collection to a new instance each time the source collection is referenced?

I have a source object which contains 2 references to the same collection. If I map the source type to a structurally-equivalent target type, AutoMapper will create two instances of the collection in the target instance. class SourceThing { …
drew
  • 306
  • 2
  • 11
1
vote
1 answer

Automapper occasionally fails to map properties set via ForMember

I've never encountered this odd behavior before from Automapper. To begin with, I'm using Automapper 3.3.0, and Entity Framework 6.1.3. I have a method that retrieves entity data via entity framework. Prior to returning the data, it is mapping it to…
Jim Speaker
  • 1,303
  • 10
  • 28
1
vote
0 answers

Automapper mapping classes with different types of the same base class

I know this sounds like a duplicate but actually I couldn't find anything about the specific topic, so please read it first before you judge :-) I want to use automapper to copy information from a pretty big class structure that I do not have under…
1
vote
2 answers

Generic Automapper function with custom convension for underscored properties

I simply need to map some auto generated classes from database to domain/viewmodels classes. The autogenerated class may have names like customer_id that I want to be mapped with CustomerId. Somehow I want to register my own convention with auto…
user1829319
  • 691
  • 1
  • 8
  • 22
1
vote
2 answers

Map a dozen of hierarchical objejcts with AutoMapper to DTOs

I have a hierarchy of 12 entity framework objects. I have also for each entity a DTO created. I want to send the DTOs over the wire. I have to use the DTO-approach. How would you map this amount of objects with Automapper? Do I have to use 12 times…
Pascal
  • 12,265
  • 25
  • 103
  • 195
1 2 3
8 9