ffernandolima / ef-core-data-access

It's a modern and generic data access structure for .NET and Microsoft.EntityFrameworkCore. It supports UnitOfWork, Repository and QueryBuilder patterns. It also includes auto history utilities, multiple databases support with distributed transactions and databases/tables sharding for some database providers.
MIT License
165 stars 25 forks source link

error when update #26

Closed MohMehrnia closed 7 months ago

MohMehrnia commented 7 months ago

when update entity show me below error

The database operation was expected to affect 1 row(s), but actually affected 0 row(s)

update code is

var updatedCourse = _mapper.Map(request.Course); var course = repository.Update(updatedCourse); await unitOfWork.SaveChangesAsync(cancellationToken: cancellationToken);

ffernandolima commented 7 months ago

Hi @MohMehrnia!

Can you please provide me a simple app with the minimum code structure and some repro steps? By doing that, I'd be able to help you.

Btw, it seems to be something from the EF Core and not from the library.

Thank you.

MohMehrnia commented 7 months ago

Full Source Code @ffernandolima

ffernandolima commented 7 months ago

Hi @MohMehrnia! I hope you're doing well. I couldn't build the project you provided me. It seems like it misses 2 reference projects. Please provide me a simple app with some repro steps, so that I can help you. Thanks for understanding.

ffernandolima commented 7 months ago

Due to the inactivity of this issue, I am closing it for now.