From f25c815506e9af00b5ecc2ff031e929b7f4957d3 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sun, 28 Jan 2024 04:30:25 +0300 Subject: [PATCH] feat: add a not found 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..7cacf74 --- /dev/null +++ b/Application/Common/Exceptions/NotFoundException.cs @@ -0,0 +1,10 @@ +using System.Reflection; +using System; + +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