AutoMapperMappingException - 上下文:尝试将String映射到String。错误

时间:2015-05-19 16:08:35

标签: automapper

我试图在两个类之间进行映射,并且遇到以下异常

3) Exception Information
********************************************* 
Exception Type: AutoMapper.AutoMapperMappingException
Context: Trying to map String to String.

Mapping types:
String -> String
System.String -> System.String

Destination path:
ChildCareCasePaymentAdjRequestEntity.UserId.UserId

VB.Net中的source属性

<DisplayName("User Id"), StringLength(6), Required()>
Public Property UserId As String

c#中的目标属性是

[Required]
[StringLength(6)]
public string UserId
{
    get { return _userId; }
    set { _userId = value.ToUpper(); }

EDIT VB.Net中的自动映射配置如下。我试图保持它非常基本。

 Mapper.CreateMap(Of SourceModel, DestinationModel)()

0 个答案:

没有答案
相关问题