manage conflict (generic way) use toast to show error (#588)
* manage conflict (generic way) use toast to show error * fix httpservice after merge conflict, adapt to use new repository
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions
|
||||
{
|
||||
public class DuplicateCatalogItemNameException : Exception
|
||||
{
|
||||
public DuplicateCatalogItemNameException(string message, int duplicateItemId) : base(message)
|
||||
{
|
||||
DuplicateItemId = duplicateItemId;
|
||||
}
|
||||
|
||||
public int DuplicateItemId { get; }
|
||||
}
|
||||
}
|
||||
14
src/ApplicationCore/Exceptions/DuplicateException.cs
Normal file
14
src/ApplicationCore/Exceptions/DuplicateException.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions
|
||||
{
|
||||
|
||||
public class DuplicateException : Exception
|
||||
{
|
||||
public DuplicateException(string message) : base(message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
|
||||
{
|
||||
public class CatalogItemNameSpecification : Specification<CatalogItem>
|
||||
{
|
||||
public CatalogItemNameSpecification(string catalogItemName)
|
||||
{
|
||||
Query.Where(item => string.Compare(catalogItemName, item.Name, true) == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user