我试图在两个类之间进行映射,并且遇到以下异常
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)()