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:
My recommendation for the guide would be to
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:
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
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:
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
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:
public string ConcurrencyStamp { get; set; }
note.SetConcurrencyStampIfNotNull(concurrencyStamp);
return await _noteRepository.UpdateAsync(note);
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