Skip to content

Commit 2bddaaa

Browse files
committed
Reverted complicated store method
1 parent 39c0abf commit 2bddaaa

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/LinkDotNet.Blog.Infrastructure/Persistence/Sql/Repository.cs

+1-10
Original file line numberDiff line numberDiff 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();

src/LinkDotNet.Blog.Web/Controller/RssFeedController.cs

+1-1
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)