Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error in AutoMapper
Message
De
16/08/2014 06:01:20
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Programmation orienté objet
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01605838
Message ID:
01605889
Vues:
44
>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 ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform