diff --git a/MyOffice.Web/Infrastructure/Filters/ResponseFilter.cs b/MyOffice.Web/Infrastructure/Filters/ResponseFilter.cs index 91e870f..ab3c28a 100644 --- a/MyOffice.Web/Infrastructure/Filters/ResponseFilter.cs +++ b/MyOffice.Web/Infrastructure/Filters/ResponseFilter.cs @@ -20,12 +20,13 @@ public class ResponseFilter : IActionFilter public void OnActionExecuted(ActionExecutedContext context) { + var route = $"{context.Controller.GetType().Name}.{context.ActionDescriptor.DisplayName}"; if (context.Result == null) - throw new NotSupportedException($"Response required"); + throw new NotSupportedException($"[{route}] Response required"); if (!(context.Result is ObjectResult result)) - throw new NotSupportedException($"Response must be an ObjectResult - {context.Result?.GetType().Name}"); + throw new NotSupportedException($"[{route}] Response must be an ObjectResult - {context.Result?.GetType().Name}"); if (result.Value == null) - throw new NotSupportedException($"Response must be an ObjectResult with value"); + throw new NotSupportedException($"[{route}] Response must be an ObjectResult with value"); if (result.Value is IResponseModel) { @@ -40,6 +41,6 @@ public class ResponseFilter : IActionFilter return; } - throw new NotSupportedException($"Response must be an ObjectResult with an IResponseModel - {result.Value?.GetType().Name}"); + throw new NotSupportedException($"[{route}] Response must be an ObjectResult with an IResponseModel - {result.Value?.GetType().Name}"); } } \ No newline at end of file diff --git a/MyOffice.Web/Models/Currency/CurrencyGlobalViewModel.cs b/MyOffice.Web/Models/Currency/CurrencyGlobalViewModel.cs index a6d160e..6b71f9a 100644 --- a/MyOffice.Web/Models/Currency/CurrencyGlobalViewModel.cs +++ b/MyOffice.Web/Models/Currency/CurrencyGlobalViewModel.cs @@ -5,7 +5,7 @@ namespace MyOffice.Web.Models.Currency; using AutoMapper; using MyOffice.Services.Currency.Domain; -public class CurrencyGlobalViewModel +public class CurrencyGlobalViewModel: IResponseModel { public string Id { get; set; } = null!; public string Name { get; set; } = null!; diff --git a/MyOffice.Web/Models/Item/ItemCategoryViewModel.cs b/MyOffice.Web/Models/Item/ItemCategoryViewModel.cs index 25e6417..d6596d5 100644 --- a/MyOffice.Web/Models/Item/ItemCategoryViewModel.cs +++ b/MyOffice.Web/Models/Item/ItemCategoryViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using AutoMapper; using Services.Account.Domain; -public class ItemCategoryViewModel +public class ItemCategoryViewModel: IResponseModel { public string? Id { get; set; }