Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error in AutoMapper
Message
From
16/08/2014 06:01:20
 
General information
Forum:
ASP.NET
Category:
Object Oriented Programming
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01605838
Message ID:
01605889
Views:
45
>Hi everybody,
>
>I am getting the following error
>
>AutoMapper.AutoMapperMappingException was unhandled by user code
> HResult=-2146233088
> Message=Missing type map configuration or unsupported mapping.
>
>Mapping types:
>RuntimeType -> Byte
>System.RuntimeType -> System.Byte
>
>Destination path:
>IEnumerable`1[0].ItemType.ItemType
>
>Source value:
>System.String
> Source=AutoMapper
>
>On this line of code:
>
>
>   assignedItems = AutoMapper.Mapper.Map<ItemForDualListViewModel[],
>                    IEnumerable<Items>>(editModifierGroupViewModel.AssignedItems.ToArray());
>
>The ItemForDualListViewModel has just a few properties that match properties in the Items class. Items class has many more properties including Byte ItemType.
>
>Why would AutoMapper produce this error?
>
>Thanks in advance.

I've never used AutoMapper but you seem to be mapping from a small object to a larger one with additional properties - do you have it the wrong way around ?
Or do you have some rule in the map which tells it how to populate ItemType ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform