Skip to content

Commit 5b21df4

Browse files
committed
fix: create many the same tags when creating new posts
1 parent 495f39d commit 5b21df4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Blog/Blog/Models/Repositories/TagRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void Create(Tag entity)
3737

3838
public void Create(string tag)
3939
{
40-
if (context.Tags.Count(x => x.Name.CompareTo(tag) == 0) == 0)
40+
if (context.Tags.Count(x => x.Name == tag.Trim()) == 0)
4141
context.Tags.Add(new Tag() { Name = tag.Trim() });
4242
}
4343

0 commit comments

Comments
 (0)