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
0
votes
1 answer

AutoMap To Eliminate Join Table

Currently I have the following Objects that I need to map OBJECT 1 public class ContactInfo { public int ContactInfoId { get; set; } public ICollection Phones { get; set; } } public class PhoneToCustomer { public int…
Brandon Turpy
  • 883
  • 1
  • 10
  • 32
0
votes
1 answer

Automapper Project() to IEnumerable and single Objects

I have two of class that will be map with another. MyViewClass and MyDomainClass public class EntityMapProfile : Profile { protected override void Configure() { Mapper.CreateMap(); } } So I need to an…
barteloma
  • 6,403
  • 14
  • 79
  • 173
0
votes
0 answers

AutoMapper IMappingEngine ConfigurationStore Initialize Not Happening

AutoMapper Version Used : 3.3.10 [TestClass] public class AppControllerTests { private IMappingEngine _mappingEngine = null; private ConfigurationStore _configurationStore = null; [TestInitialize] public void SetUp() { …
Vinod
  • 596
  • 2
  • 10
  • 28
0
votes
0 answers

Automapper mapping collections at different level

I have Source Object which will be like below, Class Employee { int EmpID { get; set; } string EmpName { get; set; } List AddressRelations { get; set; } } Class AddressRelation { int AddressRelationId { get; set; } …
ps_prakash02
  • 543
  • 4
  • 18
0
votes
2 answers

automapper optimization mapping (model to view model -> get latest version)

I am trying to optimize this part of code: Mapper.CreateMap() .ForMember(g => g.Id, map => map.MapFrom(d => d.documentVersion.Where(v => v.version == d.documentVersion.Select(s =>…
michal
  • 37
  • 2
  • 7
0
votes
1 answer

Automapper foces subobjects to be mapped

I am trying to map a response object from webservice to a Class in my project. I thought the Automapper will map even the sub objects automatically, it does not unless and until is forcefully set for the member. Why should i do this…
Dilip
  • 474
  • 2
  • 8
  • 18
0
votes
2 answers

AutoMapper DataServiceCollection to List

I am attempted to use AutoMapper to map a DataServiceCollection to a list of strings and also create the reverse mapping. Any ideas on how to map a specialized collection like this to…
Adam
  • 4,590
  • 10
  • 51
  • 84
0
votes
1 answer

An unhandled exception of type 'AutoMapper.AutoMapperMappingException' occurred in AutoMapper.dll

I want to get some understanding about how exactly Automapper is working. I know the basic idea, before I just used so called ViewModels to send the information that the business needs extracted from one or more database tables. Now I'm working on a…
Leron
  • 9,546
  • 35
  • 156
  • 257
0
votes
1 answer

'AutoMapper.Configuration' is a 'namespace' but is used like a 'type'

I am trying to upgrade AutoMapper 1.1 to AutoMapper 3.3. I have the following statement in my current code that does not work in v3.3 container.RegisterType(new…
Noor
  • 155
  • 2
  • 12
0
votes
1 answer

IQueryable Extension Behavior Differing For Automapper Polymorphic Collection

Using Automapper 3.3.1.0 there is a different mapping behavior between the usage of Mapper.Map>(someEnumerable) compared to someEnumerable.AsQueryable().Project().To() This does not appear to be a limitation…
kmoormann
  • 160
  • 3
  • 13
0
votes
1 answer

AutoMapper map Enum to SelectList - Selected value not working

I have created a map which convert an enum to a SelectList by using a custom implementation of ITypeConverter. public class DeliveryModeToSelectListTypeConverter : ITypeConverter { public SelectList Convert(…
Lorenzo
  • 29,081
  • 49
  • 125
  • 222
0
votes
0 answers

Create ITypeConverter for every Enumeration

So, basically I'm trying to create a TypeConverter to be run in any enumeration mapping. The comments inside the following code explain the problem that I currently have. If I do a map from string to Enum my TypeConverter runs. If I do a map from…
Fagner Carvalho
  • 113
  • 1
  • 1
  • 9
0
votes
3 answers

How to create expression with type cast for automapper to create map for Enum

I am having two classes : source.Employee and destination.Employee . I am getting just two name in my function destination property name i.e destination.TestEnum1 and source property name i.e source.TestEnum1. I want to create expression dynamically…
Hemant Malpote
  • 891
  • 13
  • 28
0
votes
1 answer

Problems mapping a type that inherits from IEnumerable

I have a problem mapping a property containing a custom list that inherits from IEnumerable (if i remove that inheritance, this example works). I have simplified the problem into this model: public interface IMyEnumerable : IEnumerable {…
carl
  • 375
  • 4
  • 17
0
votes
1 answer

How to map properties of another class into parent class using automapper?

I am newbie for Automapper. I have a domin and ViewModel class. I want to map the domain class to ViewModel class. Domain Class : public class PurchaseOrder { public int Id { get; set; } public string PONo { get; set; } …
bnil
  • 1,531
  • 6
  • 35
  • 68
1 2 3
8 9