booking-microservices/src/BuildingBlocks/Exception/AggregateNotFoundException.cs
2025-07-23 16:18:05 +03:30

13 lines
367 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);
}
}