From 49c3434d2971ddcfc1c93c5d8b57dadf24c07dcd Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Wed, 12 Jan 2022 12:02:55 -0500 Subject: [PATCH] use DbSet Update method in repo Update method --- .../RepositoryBaseOfT.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Specification.EntityFrameworkCore/src/Ardalis.Specification.EntityFrameworkCore/RepositoryBaseOfT.cs b/Specification.EntityFrameworkCore/src/Ardalis.Specification.EntityFrameworkCore/RepositoryBaseOfT.cs index 3ab92ebf..f36da477 100644 --- a/Specification.EntityFrameworkCore/src/Ardalis.Specification.EntityFrameworkCore/RepositoryBaseOfT.cs +++ b/Specification.EntityFrameworkCore/src/Ardalis.Specification.EntityFrameworkCore/RepositoryBaseOfT.cs @@ -37,7 +37,7 @@ public virtual async Task AddAsync(T entity, CancellationToken cancellationTo /// public virtual async Task UpdateAsync(T entity, CancellationToken cancellationToken = default) { - dbContext.Entry(entity).State = EntityState.Modified; + dbContext.Set().Update(entity); await SaveChangesAsync(cancellationToken); }