booking-microservices/BuildingBlocks/Exception/AggregateNotFoundException.cs
2025-03-15 01:39:43 +03:30

14 lines
368 B
C#

namespace BuildingBlocks.Exception;
public class AggregateNotFoundException : System.Exception
{
public AggregateNotFoundException(string typeName, Guid id) : base($"{typeName} with id '{id}' was not found")
{
}
public static AggregateNotFoundException For<T>(Guid id)
{
return new AggregateNotFoundException(typeof(T).Name, id);
}
}