- ABP Framework version: v.6.0.0 (v5.3.3 other packages)
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.Account.Web.Pages.Account.LoginModel -> Volo.Abp.Account.AccountAppService -> Volo.Abp.Account.Emailing.AccountEmailer -> Volo.Abp.UI.Navigation.Urls.AppUrlProvider -> Volo.Abp.TenantManagement.TenantStore -> Volo.Abp.ObjectMapping.DefaultObjectMapper
1[[Volo.Abp.TenantManagement.AbpTenantManagementDomainModule, Volo.Abp.TenantManagement.Domain, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null]] -> Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider
1[[Volo.Abp.TenantManagement.AbpTenantManagementDomainModule, Volo.Abp.TenantManagement.Domain, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null]] -> λ:Volo.Abp.AutoMapper.IMapperAccessor -> λ:Volo.Abp.AutoMapper.MapperAccessor. ---> 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 ====================================================================================== DatabaseBlob -> BlobDto (Destination member list) Volo.Abp.BlobStoring.Database.DatabaseBlob -> IT42Portal.AssetManagement.Blob.BlobDto (Destination member list)
Unmapped properties: Category
- Steps to reproduce the issue:"
Hi, I have downloaded a module template with abp suite. Then I have created a UnifiedEfCoreEntityExtensionMappings.cs in the xxx.Web.Unified Module. This Class contains the code for the extension
public static void Configure()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance
.MapEfCoreProperty<DatabaseBlob, bool>("AdditionalProperty");
more extensions .....
});
}
I call this method in the UnifieddbContextFactory.cs.
public UnifiedDbContext CreateDbContext(string[] args)
{
UnifiedEfCoreEntityExtensionMappings.Configure(); // HERE
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<UnifiedDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
return new UnifiedDbContext(builder.Options);
}
The migrations is created and the extensions are done in the database. But when I create the mappings I always got the above mentioned exception.
May mappings are done in the xxx.Application.Module and looks like this
CreateMap<DatabaseBlob, BlobDto>()
.MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true)
.ReverseMap();
... more mappings they look identical
What should I do that the mapping works ?
thank you for your help
15 Answer(s)
-
0
hi manuel42
I will check this.
-
0
Hi maliming,
thank you for checking. In the meantime I have tried to use another template where all packages have the same version (5.3.4). I got the same error.
-
0
hi
Please share your project to liming.ma@volosoft.com
-
0
I have sent it to you.
-
0
hi I didn't received it yet, Can you confirm that?
-
0
I have sent it as 7zip but it was blocked. How should I sent it to you ?
-
0
You can create a GitHub private repository and invite me. https://github.com/maliming
-
0
Done you should received the inivite
-
0
-
0
hi
CreateMap<DatabaseBlob, BlobDto>(MemberList.Destination) .MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true); CreateMap<BlobDto, DatabaseBlob>(MemberList.Source) .MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true); CreateMap<DatabaseBlob, CreateBlobDto>(MemberList.Destination) .MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true); CreateMap<CreateBlobDto, DatabaseBlob>(MemberList.Source) .MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true); CreateMap<DatabaseBlob, UpdateBlobDto>(MemberList.Destination) .MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true); CreateMap<UpdateBlobDto, DatabaseBlob>(MemberList.Source) .MapExtraProperties(MappingPropertyDefinitionChecks.None, null, true);
-
0
Hi same error again. I also have created the constructor.
DatabaseBlob -> BlobDto (Destination member list) Volo.Abp.BlobStoring.Database.DatabaseBlob -> IT42Portal.AssetManagement.Blob.BlobDto (Destination member list)
Unmapped properties: Category
BlobDto -> DatabaseBlob (Source member list) IT42Portal.AssetManagement.Blob.BlobDto -> Volo.Abp.BlobStoring.Database.DatabaseBlob (Source member list)
Unmapped properties: Category No available constructor.
DatabaseBlob -> CreateBlobDto (Destination member list) Volo.Abp.BlobStoring.Database.DatabaseBlob -> IT42Portal.AssetManagement.Blob.CreateBlobDto (Destination member list)
-
0
hi
you can configure the properties by automapper documents
https://docs.automapper.org/en/stable/Projection.html
-
0
How can I select the extensions properties from the DatabaseBlob in the mapper ? I always got a exception I tried to acces the properties like this
.ForPath(dest => dest.ExtraProperties["Category"], opt => opt.MapFrom(src => src.Category))
-
0
OK, I will check again
-
1
Finally I found the solution
.ForMember(dest => dest.ExtraProperties, opt => opt.MapFrom(r => new Dictionary<string, object>() { { "Category", r.Category }, .... and so on))
Maybe this will help others. Thank you maliming for your help.