From af7e3704943a6c869df4d3345ee040ce3c1f4afe Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sun, 21 Jan 2024 22:52:12 +0300 Subject: [PATCH] feat: add a new exception --- Application/Common/Exceptions/NotFoundException.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Application/Common/Exceptions/NotFoundException.cs diff --git a/Application/Common/Exceptions/NotFoundException.cs b/Application/Common/Exceptions/NotFoundException.cs new file mode 100644 index 0000000..c310b74 --- /dev/null +++ b/Application/Common/Exceptions/NotFoundException.cs @@ -0,0 +1,10 @@ +using System; +using System.Reflection; + +namespace Mirea.Api.DataAccess.Application.Common.Exceptions; + +public class NotFoundException : Exception +{ + public NotFoundException(MemberInfo entity, string name, object id) : base($"The entity \"{entity.Name}\" property \"{name}\" was not found by id \"{id}\".") { } + public NotFoundException(MemberInfo entity, object id) : base($"The entity \"{entity.Name}\" was not found by id \"{id}\".") { } +} \ No newline at end of file