Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to set GUID Id in the InsertAsync method of the EF Core repository #4631

Closed
hikalkan opened this issue Jul 5, 2020 · 2 comments · Fixed by #4634
Closed

Try to set GUID Id in the InsertAsync method of the EF Core repository #4631

hikalkan opened this issue Jul 5, 2020 · 2 comments · Fixed by #4634

Comments

@hikalkan
Copy link
Member

hikalkan commented Jul 5, 2020

In this way, we don't need to wait until SaveChangesAsync if we use GUID Id but not set it before InsertAsync call.
It is currently like that for the MongoDbRepository.

Note: Apply the same logic inside the AbpDbContext.CheckAndSetId

@gdlcf88
Copy link
Contributor

gdlcf88 commented Jul 6, 2020

Greate! It also ensures that the Ids of all new entities are generated by IGuidGenerator by default (except unfortunately for new entities of navigation properties).

@dicksonkimeu
Copy link

This will be great. I had to write alot of code since this was missing. I.e to ensure uniqueness of records before saving to db etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants