Error becuase this line , which assembly is to be added to address this, log file shows this error.
-----------------------------------------------------------Logs.txt----------- ERROR 2018-01-16 22:29:34,451 [31 ] Mvc.ExceptionHandling.AbpExceptionFilter - Unmapped members were found. Review the types and members below. Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
CreatePersonInput -> Person (Destination member list) Noor.ClassMateDemo.ClassMate.Dto.CreatePersonInput -> Noor.ClassMateDemo.ClassMate.Person (Destination member list)
Unmapped properties: IsDeleted DeleterUserId DeletionTime LastModificationTime LastModifierUserId CreationTime CreatorUserId Id
AutoMapper.AutoMapperConfigurationException: Unmapped members were found. Review the types and members below. Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
CreatePersonInput -> Person (Destination member list) Noor.ClassMateDemo.ClassMate.Dto.CreatePersonInput -> Noor.ClassMateDemo.ClassMate.Person (Destination member list)
Unmapped properties: IsDeleted DeleterUserId DeletionTime LastModificationTime LastModifierUserId CreationTime CreatorUserId Id
at AutoMapper.ConfigurationValidator.AssertConfigurationIsValid(IEnumerable`1 typeMaps) at AutoMapper.MapperConfiguration.AssertConfigurationIsValid(TypeMap typeMap) at lambda_method(Closure , CreatePersonInput , Person , ResolutionContext ) at lambda_method(Closure , Object , Object , ResolutionContext ) at AutoMapper.Mapper.AutoMapper.IMapper.Map[TDestination](Object source) at Abp.AutoMapper.AutoMapperObjectMapper.Map[TDestination](Object source) at Noor.ClassMateDemo.ClassMate.PersonAppService.
10 Answer(s)
-
0
Duplicate of #4367@4a050a71-139c-436b-a11c-63f170c486d1
Can you show the definition of CreatePersonInput and Person?
-
0
using System.ComponentModel.DataAnnotations;
namespace Noor.ClassMateDemo.ClassMate.Dto {
public class CreatePersonInput { [Required] [MaxLength(PersonConsts.MaxNameLength)] public string Name { get; set; } [Required] [MaxLength(PersonConsts.MaxSurnameLength)] public string Surname { get; set; } [EmailAddress] [MaxLength(PersonConsts.MaxEmailAddressLength)] public string EmailAddress { get; set; } }
}
using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Abp.Domain.Entities; using Abp.Domain.Entities.Auditing;
namespace Noor.ClassMateDemo.ClassMate { [Table("PbPersons")] public class Person : FullAuditedEntity { [Required] [MaxLength(PersonConsts.MaxNameLength)] public virtual string Name { get; set; }
[Required] [MaxLength(PersonConsts.MaxSurnameLength)] public virtual string Surname { get; set; } [MaxLength(PersonConsts.MaxEmailAddressLength)] public virtual string EmailAddress { get; set; } }
}
using System; using System.Collections.Generic; using System.Text;
namespace Noor.ClassMateDemo.ClassMate { public class PersonConsts { public const int MaxNameLength = 32; public const int MaxSurnameLength = 32; public const int MaxEmailAddressLength = 255; } }
-
0
-
0
- Which version of Abp.AutoMapper package are you using?
- Why are there red squiggly lines?
-
0
-
0
Did you mean that:
- in "Acme.PhoneBookDemo.Application.Shared", CreatePersonInput does not have [AutoMapTo(typeof(Person))], and
- adding it will fix the error?
-
0
cannot add Abp.Automapper as the project in demo references SDK net461 and netstandard library but the project that i generated only references .netstandardlibrary no reference to sdk net461 is found.
Regards Anwar
-
0
You should not need to reference net461 as Abp.AutoMapper targets netstandard2.0.
-
0
<cite>aaron: </cite> You should not need to reference net461 as Abp.AutoMapper targets netstandard2.0.
aron,
thanks for your response
dear aaron i have put the dependencies of the demo project and my project maaybe this will give a clearer picture
-
0
Are there any errors?