Hi @maliming,
The code I am using has code pertaining to our active project development. If possible could you please remote desktop and see the code?
2021-09-15 10:34:23.663 +04:00 [ERR]
---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "An internal error occurred during your request!",
"details": null,
"data": {},
"validationErrors": null
}
2021-09-15 10:34:23.665 +04:00 [ERR] Error mapping types.
Mapping types:
Employee -> EmployeeDto
ZW.EmployeeMgmtSvc.Employees.Employee -> ZW.EmployeeMgmtSvc.Employees.EmployeeDto
Type Map configuration:
Employee -> EmployeeDto
ZW.EmployeeMgmtSvc.Employees.Employee -> ZW.EmployeeMgmtSvc.Employees.EmployeeDto
Destination Member:
Contacts
AutoMapper.AutoMapperMappingException: Error mapping types.
Mapping types:
Employee -> EmployeeDto
ZW.EmployeeMgmtSvc.Employees.Employee -> ZW.EmployeeMgmtSvc.Employees.EmployeeDto
Type Map configuration:
Employee -> EmployeeDto
ZW.EmployeeMgmtSvc.Employees.Employee -> ZW.EmployeeMgmtSvc.Employees.EmployeeDto
Destination Member:
Contacts
---> AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.
Mapping types:
Contact -> ContactDto
ZW.EmployeeMgmtSvc.Contacts.Contact -> ZW.EmployeeMgmtSvc.Contacts.ContactDto
at lambda_method3391(Closure , Contact , ContactDto , ResolutionContext )
at lambda_method3390(Closure , Object , EmployeeDto , ResolutionContext )
--- End of inner exception stack trace ---
at lambda_method3390(Closure , Object , EmployeeDto , ResolutionContext )
at Volo.Abp.ObjectMapping.DefaultObjectMapper.Map[TSource,TDestination](TSource source)
at ZW.EmployeeMgmtSvc.Employees.EmployeeAppService.CreateAsync(EmployeeCreateAndUpdateDto input) in D:\Workspace\EmployeeMgmtSvc\aspnet-core\src\ZW.EmployeeMgmtSvc.Application\Employees\EmployeeAppService.cs:line 90
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at lambda_method2489(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2021-09-15 10:34:23.677 +04:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2021-09-15 10:34:23.690 +04:00 [INF] Executed action ZW.EmployeeMgmtSvc.Employees.EmployeeAppService.CreateAsync (ZW.EmployeeMgmtSvc.Application) in 7668.1201ms
2021-09-15 10:34:23.690 +04:00 [INF] Executed endpoint 'ZW.EmployeeMgmtSvc.Employees.EmployeeAppService.CreateAsync (ZW.EmployeeMgmtSvc.Application)'
2021-09-15 10:34:24.889 +04:00 [DBG] Added 0 entity changes to the current audit log
2021-09-15 10:34:24.889 +04:00 [DBG] Added 0 entity changes to the current audit log
there are 3 maps apart from this. but i am getting error saying there is mapping issue inside employee with the contact entity.
I have the following classes:
public class Employee : FullAuditedEntity<Guid>
{
<<<<properties....>>>
public ICollection<Contact> Contacts {get;set;}
}
public class Contact : FullAuditedEntity<Guid>
{
<<<properties...>>>
public ICollection<Address> Addresses {get;set;}
}
public class Address : FullAuditedEntity<Guid>
{
<<<properties...>>>
}
Which means an employee can have multiple contacts and each contact can have multiple addresses.
Now I have the following Dtos to insert 1 employee record.
public class EmployeeDto : FullAuditedEntityDto<Guid>
{
<<<<properties....>>>
public ICollection<ContactDto> Contacts {get;set;}
}
public class ContactDto : FullAuditedEntityDto<Guid>
{
<<<properties...>>>
public ICollection<AddressDto> Addresses {get;set;}
}
public class AddressDto : FullAuditedEntityDto<Guid>
{
<<<properties...>>>
}
I have the following automapper configuration for layer 1 mapping, where we map employee to employeeDto and contact to contactdto.
CreateMap<Employee, EmployeeDto>()
.ForMember(dest => dest.Contacts,
opt => opt.MapFrom(src => src.Contacts));
How can we map the address in contact to the addressdto in contactdto?
Or is there a more reliable method. Thank you
hi,
Please update.
Thanks
I created a new abp solution using the abp cli. The following are the projects within the created solution:
When I run the dbmigrator project I get the following error:
But when I run command: dotnet ef migrations add "test" it doesn't apply the fluent api settings to the database.
I've added some entities and added the fluent api in a different class.
I have created "EfCoreFluentApiConfiguration.cs" file and added public static void ConfigureProjectName(this ModelBuilder builder)
.
Then I called it in the dbcontext class using builder.ConfigureProjectName();
However the fluent api config i added is not reflecting in the migration when i use the cli. But when i run the dbmigrator project i get the error as i mentioned.
Thank you.
Do you have a dockerfile sample that uses the focal image as mentioned in your other threads.
Tx
I have run the app inside container as root. The host system is windows, I dont think there is any permissions I should set, if not please let me know what to do.
Click here to see the error log when app is run in container as root.
hi
this is the same docker command we used with .net 5.0 project.
How can we mitigate this?
tx
Please find the full error log in this link.