mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Move fix to storage layer
Don't know if this is the better way but works.
This commit is contained in:
1 parent
ccbb57f88b
commit
6bf6374e00
2 files changed
+2
-1
No files matched your search
@@ -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);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace Artemis.UI.Screens.Sidebar.Dialogs
|
|||||||
|
|
||||||
private bool BeUniqueCategory(SidebarCategoryCreateViewModel viewModel, string categoryName)
|
private bool BeUniqueCategory(SidebarCategoryCreateViewModel viewModel, string categoryName)
|
||||||
{
|
{
|
||||||
return _profileCategoryRepository.IsUnique(categoryName.Trim(), null) == null;
|
return _profileCategoryRepository.IsUnique(categoryName, null) == null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user