File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
LinkDotNet.Blog.Infrastructure/Persistence/Sql
LinkDotNet.Blog.Web/Controller Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,7 @@ public async ValueTask StoreAsync(TEntity entity)
6969 }
7070 else
7171 {
72- var dbEntity = blogDbContext . Set < TEntity > ( ) . Local . FirstOrDefault ( e => e . Id == entity . Id ) ;
73- if ( dbEntity != null )
74- {
75- blogDbContext . Entry ( dbEntity ) . CurrentValues . SetValues ( entity ) ;
76- blogDbContext . Entry ( dbEntity ) . State = EntityState . Modified ;
77- }
78- else
79- {
80- blogDbContext . Entry ( entity ) . State = EntityState . Modified ;
81- }
72+ blogDbContext . Entry ( entity ) . State = EntityState . Modified ;
8273 }
8374
8475 await blogDbContext . SaveChangesAsync ( ) ;
Original file line number Diff line number Diff line change @@ -107,5 +107,5 @@ private sealed record BlogPostRssInfo(
107107 string ShortDescription ,
108108 DateTime UpdatedDate ,
109109 string PreviewImageUrl ,
110- ICollection < string > Tags ) ;
110+ IReadOnlyCollection < string > Tags ) ;
111111}
You can’t perform that action at this time.
0 commit comments