型号:
public class CredentialAPIModel
{
public string UserName { get; set; }
public string Password { get; set; }
}
和
public class CredentialEntity
{
public string UserName { get; set; }
public string Password { get; set; }
}
我的映射:
Mapper.CreateMap<CredentialEntity, CredentialAPIModel>();
Mapper.CreateMap<CredentialAPIModel, CredentialEntity>();
这就是它失败的地方:
public LoginAPIResponse Login(CredentialAPIModel credentials)
{
CredentialEntity credentialEntity = Mapper.Map<CredentialAPIModel, CredentialEntity>(credentials);
LoginResponse appSecurityResponse = BO.Login(credentialEntity);
.
.
.
}
我明白了:
Missing type map configuration or unsupported mapping.
Mapping types:
CredentialAPIModel -> CredentialEntity
FMG.WebServiceAPI.Models.AppSecurity.Models.CredentialAPIModel -> FMG.Entities.AppSecurity.Entities.CredentialEntity
Destination path:
CredentialEntity
Source value:
FMG.WebServiceAPI.Models.AppSecurity.Models.CredentialAPIModel
Mapper.AssertConfigurationIsValid()没有发现任何错误。
有人在这里看到了什么问题吗?
由于