Merge pull request #613 from Cheerpipe/development

Fixes duplicate category bypass exception
This commit is contained in:
Robert Beekman authored and GitHub committed 2021-06-08 20:39:29 +02:00
commit 7293d11aa4
1 file changed
+1
@@ -41,6 +41,7 @@ namespace Artemis.Storage.Repositories
public ProfileCategoryEntity IsUnique(string name, Guid? id) public ProfileCategoryEntity IsUnique(string name, Guid? id)
{ {
name = name.Trim();
if (id == null) if (id == null)
return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Name == name); return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Name == name);
return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Name == name && p.Id != id.Value); return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Name == name && p.Id != id.Value);