Activities of "rogercprops"

Hi,

You're correct that it's an empty service solution because it was created using the ABP CLI for creating a new micro-service

Since Abp Suite doesn't allow adding new microservices to an existing solution, what we usually do is create a duplicate solution using Abp Suite and the Application template so it can automatically generate the code shell for the entity(ies). For example calling it CprOnAbp.StaffService. For EF Core it's a fairly straight forward process to copy the appropriate folders and files from the application template to the micro-service template because Abp Suite generates all of the code in a similar structure as abp new [service name] -t microservice-service-pro --no-ui.

Because the ABP CLI doesn't allow for creation of a microservice using Mongo DB there should be clear instructions on how to change from EF Core to MongoDB.

Also, the guide seems to be based on all services being MongoDB. IMO, this goes against a micro-service architecture principle where the underlying code and database for each service are independent. We should be able to have a mix of EF Core & MongDB services depending on the use case.

Having said all that, following the guide and creating a new Microservice solution and updating the product service I was still not able to find:

  • Volo.Abp.PermissionManagement.EntityFrameworkCore
  • AbpPermissionManagementEntityFrameworkCoreModule
  • IProductServiceDbContext
  • PendingMigrationsCheckerBase

My recommendation for the guide would be to

  • Create a new micro-service in an existing micro-service solution
  • Create a new project for MongoDB and delete the EntityFrameworkCore project. Provide specific code for each file/class in the MongoDB project.
  • Add the steps and code to migrate/seed the data within the service. Would be nice to have the shared dbMigrator do it but not necessary.

For now, I'll do my best to update the service for MongoDB and I'll be happy to share the steps and code if I'm successful.

Hi,

I created a new microservice called StaffService From your guide I could not find the following in my solution:

  • Volo.Abp.PermissionManagement.EntityFrameworkCore
  • AbpPermissionManagementEntityFrameworkCoreModule
  • the Migrations folder
  • IStaffServiceDbContext
  • EfCoreStaffRepository
  • CprOnApbDbMigrationService
  • class DatabaseMigrationEventHandlerBase
  • PendingMigrationsCheckerBase

I get the following errors: StaffServiceEntityFrameworkCoreModule.cs [DependsOn( typeof(AbpMongoDbModule), typeof(StaffServiceDomainModule) )] error: The type or namespace name 'AbpMongoDbModule' could not be found (are you missing a using directive or an assembly reference?)CS0246

context.Services.AddMongoDbContext<StaffServiceDbContext>(options => error: IServiceCollection' does not contain a definition for 'AddMongoDbContext' and no accessible extension method 'AddMongoDbContext' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)CS1061

  • ABP Framework version: Commercial v7.2.0
  • UI Type: N/A
  • Database System: MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: N/A
  • Steps to reproduce the issue: N/A

Our solution is built on the Microervice template. We want to create a microservice using MongoDb instead of EF Core for SQL Server. Note this is not for all microservices.

The documentation for changing the database from EF Core to MongoDb is out of date: https://docs.abp.io/en/commercial/7.2/guides/microservice-mongodb

For example: Some of the changes appear to be in the EntityFrameworkCore project and some in the domain project but it's not clear. Making changes in the EntityFrameworkCore project doesn't make sense since it's being replaced by MongDb.

Also, these dont' exist: Remove Migrations folder. Update BookStoreDbMigrationService class to the following: (substitute BookStore with the microservice name)

Since Abp Suite doesn't support selecting the database for the Microservice template I created a project using Abp Suite and the Application template for MongDb. Now I'm trying to translate into the Microservice project structure and am struggling.

Please update the documentation, point me to an accurate solution or tell me I'm mistaken.

Thank you.

The 2 biggest issues I have with the support are:

  1. One line answers with no explanation or details. For example: "Add an override to the X method" and then a link to code on GitHub
  2. Similar to item 1, single line responses that are a link to documentation that doesn't answer the question and in most cases we've already read.
Question

I submitted a question 6452.

Mailiming gave us something to try. I asked that the question not be closed because we had not had a chance to test out the solution. Now that we have and it doesn't work we need a different solution.

I don't want this to be charged against our annual support question total since I specifically asked that it not be closed.

Thank you

Hi @mailiming,

I did review that document earl and as you pointed out, the autosave parameter is not mentioned.

It might be helpful to other to to update the documentation.

Thanks

That fixed it. Thank you.

Is there mention of this in the documentation? If so, can you send a link?

Since this is a microservice that's part of our Microservice solution, I created a minimal repository using the Microservice Template and copied the notes service.

You should have everything you need to run it.

https://github.com/roger-cprops/CprOnAbp-Test

Hi,

I just gave you read access to the GitHub repository: https://github.com/cpr-ops/notes-service

  • ABP Framework version: v7.2.2
  • UI Type: N/A
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: N/A

When an entity in the database is updated through an API call to the repository UpdateAsync method, I would expect it to return the concurrencyStamp that's updated in the database in the response. However it's returning the concurrencyStamp that was sent in the request. It returns the updated lastModificationTime and lastModifierId so I'm not sure why it doesn't return the updated concurrencyStamp

I've only found similar problems to this in Discord and the Abp support questions but no resolution.

Steps to reproduce the issue:

  • Create a new module or application using Abp Suite
  • Create an entity as FullAuditedAggregateRoot. For example Note
  • Add properties to the entity
  • Save the project and generate the code
  • The Dto for the entity should have public string ConcurrencyStamp { get; set; }
  • In the domain service manager (e.g. public class NotesManager : DomainService) the UpdateAsync method should have
note.SetConcurrencyStampIfNotNull(concurrencyStamp);
return await _noteRepository.UpdateAsync(note);
  • Using postman or some other method, call the POST method to add a new entity
  • Using postman or some other method, call the PUT method to update the entity created in the previous step
  • Make note of the concurrencyStamp returned
  • Look in the database table for the entity and note the concurrencyStamp in the table
  • Compare the concurrencyStamp of the PUT request payload and response
  • The concurrency stamps from in the request and response are the same

Here's the PUT request payload: { clientId: "6df04165-acd7-18dd-7ccd-3a0d2bc61b4a" clientName: "Peyton Floris" concurrencyStamp : "dbca526c0d9f4b69b49a4cf992fc0079" text: "Something something" }

Here's the response payload { "clientId": "6df04165-acd7-18dd-7ccd-3a0d2bc61b4a", "clientName": "Peyton Floris", "text": "Something something", "concurrencyStamp": "dbca526c0d9f4b69b49a4cf992fc0079", "isDeleted": false, "deleterId": null, "deletionTime": null, "lastModificationTime": "2024-01-25T11:17:09.740494-06:00", "lastModifierId": "9bb21ac9-d3ac-887e-b521-3a0c9c5d08d6", "creationTime": "2023-11-27T09:40:40.03589", "creatorId": "9bb21ac9-d3ac-887e-b521-3a0c9c5d08d6", "id": "b5a37273-6cfc-3a7f-f4f3-3a0f239d6c90" } Here's the concurrency stamp showing in the database. Please note, I'm the only one hitting this database in test 75aeaf08163242128737360e611e1496

Showing 1 to 10 of 31 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11