Activities of "Neozzz"

Hi,

We were looking at the easycrm example from abp docs.

We've seen the advanced search implementation to retrieve a list of accounts through advanced search. Here we can at a time search and apply filter for only one word per field, for example we can retrieve a list of all accounts where country is USA.

Similarly, do we have any example or reference docs where we can obtain a list of accounts where country is USA, New Zealand, Italy etc. for example? Something where we can pass multiple words as search terms to each fields?

Thank you.

  • ABP Framework version: v4.4.3
  • UI type: swagger/angular
  • DB provider: EF Core & MongoDB

We have 4 microservice services which are being independently developed as separate applications. They have their own angular projects.

These applications are being ported into the microservice solution. It has it's own angular projects. How should we go about when it comes to merging the UI?

Will we have modules for each of these microservices and can it be generated in the main microservice angular project? If not, is there any best practices to follow while merging these independent angular ui projects of these separate applications?

Thank you

  • ABP Framework version: v4.4.3
  • UI type: Angular
  • DB provider: EF Core & MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): microservice

I have added a microservice service to a microservice solution. I followed the directions given in this doc: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice#running-the-solution

Then followed this doc: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/synchronous-interservice-communication#updating-orderservice-application-contracts

Then did a migration and ran the project using:

tye run --watch

I am able to access the newly added end-point in swagger. But when I post data I get the error mentioned in the title.

The following is the trace.

Request starting HTTP/2 POST https://localhost:44337/api/app/product-type application/json 1122
2021-11-01 13:02:21.649 +04:00 [INF] Executing endpoint 'ZW.ProductSvc.ProductTypes.ProductTypeController.CreateAsync (ZW.ProductSvc.HttpApi)'
2021-11-01 13:02:21.660 +04:00 [INF] Route matched with {action = "Create", controller = "ProductType", area = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Guid] CreateAsync(ZW.ProductSvc.ProductTypes.ProductTypeCreateDto) on controller ZW.ProductSvc.ProductTypes.ProductTypeController (ZW.ProductSvc.HttpApi).
2021-11-01 13:02:21.662 +04:00 [ERR] The required antiforgery cookie ".AspNetCore.Antiforgery.Schh12Bn9tQ" is not present.
2021-11-01 13:02:21.662 +04:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'.
2021-11-01 13:02:21.665 +04:00 [INF] Executing HttpStatusCodeResult, setting HTTP status code 400
2021-11-01 13:02:21.665 +04:00 [INF] Executed action ZW.ProductSvc.ProductTypes.ProductTypeController.CreateAsync (ZW.ProductSvc.HttpApi) in 5.2878ms
2021-11-01 13:02:21.665 +04:00 [INF] Executed endpoint 'ZW.ProductSvc.ProductTypes.ProductTypeController.CreateAsync (ZW.ProductSvc.HttpApi)'
2021-11-01 13:02:22.658 +04:00 [DBG] Added 0 entity changes to the current audit log
2021-11-01 13:02:22.658 +04:00 [DBG] Added 0 entity changes to the current audit log
2021-11-01 13:02:22.663 +04:00 [INF] Request finished HTTP/2 POST https://localhost:44337/api/app/product-type application/json 1122 - 400 0 - 1016.7524ms

Please let me know what might be causing this issue.

Thank you

Error: The instance of entity type 'Address' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values. System.InvalidOperationException: The instance of entity type 'Address' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

Consider the following domain models:

public class Employee : FullAuditedEntity<Guid>
{
    <<<<properties....>>>
    public ICollection<Contact> Contacts {get;set;}   
}

public class Contact : FullAuditedEntity<Guid>
{
    <<<properties...>>>
    public ICollection<Address> Addresses {get;set;}
}

We're trying to update employee info and the addresses associated with the employee with the put api. However we're getting this error when trying to update Addresses.

we're using individual repos for updating using updateasync and updatemanyasync.

Please let me know what might be the issue.

Thank you

Hi,

I've put 2 microservices for testing into a docker container that uses mongodb. Authorization works there. I have used the same config in the appsettings.json for dbmigrator and apihost projects for my current project that uses ef core. However when I try to authorize the request I am getting the below error:

I have checked the IdentityServerClients and redirecturis tables and I could find the relevant entries with the testing internal domain name but still I get the error. Since reproducing this at your end might be difficult, please let me know if you guys could take remote and see.

Thank you,

  • ABP Framework version: v4.4.0
  • UI type: Swagger
  • DB provider: EF Core

We perform delete function on EntityName by calling the DeleteAsync on the repository EntityNameRepository.

However EntityName has a number of child tables. DeleteAsync sets the IsDeleted value to true for the EntityName however that doesn't happen for the child entities of EntityName.

How to cascade delete all entities associated with EntityName

We have the following relationships:

public class Employee : FullAuditedEntity<Guid>
{
    <<<<properties....>>>
    public ICollection<Contact> Contacts {get;set;}   
}

public class Contact : FullAuditedEntity<Guid>
{
    <<<properties...>>>
    public ICollection<Address> Addresses {get;set;}
}

An employee can have multiple contacts and each contact can have multiple addresses. The following is a snippet of the json request for POST

{
"FirstName":"Neo",
"LastName":"Xav",
"Age":"20",
"Contact":[
{...},
{...},
{"Address":[{...},{...}]}
]
}

However I am getting the below error from logs when I use the CreateAsync method: The instance of entity type 'Contact' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

Please let me know what might be causing the issue.

Thank you

  • ABP Framework version: v4.4.2
  • UI type: swagger
  • DB provider: EF Core

We're able to create an entity using the POST request, but however when use the GET request to GET the entity using the below code in the appservice, we're getting 404 error: { "error": { "code": null, "message": "There is no entity [EntityName] with id = 198ef20c-...!", "details": null, "data": null, "validationErrors": null } }

The id requested is the id that we obtained from Swagger response when we made the POST request. The same record is available in the DB as we can see it through SSMS.

EntityNameAppService.cs public async Task<EntityNameDto> GetAsync(Guid id) { var entityName = await _entityNameRepository.GetAsync(id, true); return ObjectMapper.Map<EntityName, EntityNameDto>(entityName); }

Below is logs:

{
  "code": null,
  "message": "There is no entity EntityName with id = 198ef20c-...!",
  "details": null,
  "data": null,
  "validationErrors": null
}

2021-09-26 12:56:45.431 +04:00 [ERR] There is no such an entity. Entity type: ZW.ProjectName.EntityNames.EntityName, id: 198ef20c-...
Volo.Abp.Domain.Entities.EntityNotFoundException: There is no such an entity. Entity type: ZW.ProjectName.EntityNames.EntityName, id: 198ef20c-...
   at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository`3.GetAsync(TKey id, Boolean includeDetails, CancellationToken cancellationToken)
   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 ZW.ProjectName.EntityNames.EntityNameAppService.GetAsync(Guid id) in D:\Workspace\ProjectName\aspnet-core\src\ZW.ProjectName.Application\EntityNames\EntityNameAppService.cs:line 110
   at lambda_method2484(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.&lt;InvokeNextActionFilterAsync&gt;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.&lt;InvokeInnerFilterAsync&gt;g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2021-09-26 12:56:45.496 +04:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2021-09-26 12:56:45.513 +04:00 [INF] Executed action ZW.ProjectName.EntityNames.EntityNameAppService.GetAsync (ZW.ProjectName.Application) in 5217.3693ms
2021-09-26 12:56:45.514 +04:00 [INF] Executed endpoint 'ZW.ProjectName.EntityNames.EntityNameAppService.GetAsync (ZW.ProjectName.Application)'

  • ABP Framework version: v4.4.2
  • UI type: swagger
  • DB provider: EF Core

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

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.

  • ABP Framework version: v4.4.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
Showing 1 to 10 of 20 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11