From 2b07713b738ad894b956ebc42191cc0c44bc16a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 22 Jul 2021 13:46:20 +0300 Subject: [PATCH] refactor --- src/EventHub.Domain.Shared/EventHubErrorCodes.cs | 2 +- src/EventHub.Domain/Events/EventManager.cs | 2 +- .../Events/Registrations/EventRegistrationManager.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EventHub.Domain.Shared/EventHubErrorCodes.cs b/src/EventHub.Domain.Shared/EventHubErrorCodes.cs index 8268063..148225b 100644 --- a/src/EventHub.Domain.Shared/EventHubErrorCodes.cs +++ b/src/EventHub.Domain.Shared/EventHubErrorCodes.cs @@ -9,7 +9,7 @@ public const string CantRegisterOrUnregisterForAPastEvent = "EventHub:CantRegisterOrUnregisterForAPastEvent"; public const string NotAuthorizedToUpdateOrganizationProfile = "EventHub:NotAuthorizedToUpdateOrganizationProfile"; public const string CapacityOfEventFull = "EventHub:CapacityOfEventFull"; - public const string CapacityCantBeLowerThanRegisteredUserCount = "EventHub:CapacityCantBeLowerThanRegisteredUserCount"; + public const string CapacityCanNotBeLowerThanRegisteredUserCount = "EventHub:CapacityCantBeLowerThanRegisteredUserCount"; public const string NotAuthorizedToUpdateEvent = "EventHub:NotAuthorizedToUpdateEvent"; public const string CantChangeEventTiming = "EventHub:CantChangeEventTiming"; public const string SessionTimeShouldBeInTheEventTime = "EventHub:SessionTimeShouldBeInTheEventTime"; diff --git a/src/EventHub.Domain/Events/EventManager.cs b/src/EventHub.Domain/Events/EventManager.cs index 3f87ac5..69171b1 100644 --- a/src/EventHub.Domain/Events/EventManager.cs +++ b/src/EventHub.Domain/Events/EventManager.cs @@ -53,7 +53,7 @@ namespace EventHub.Events var registeredUserCount = await _eventRegistrationRepository.CountAsync(x => x.EventId == @event.Id); if (capacity.Value < registeredUserCount) { - throw new BusinessException(EventHubErrorCodes.CapacityCantBeLowerThanRegisteredUserCount); + throw new BusinessException(EventHubErrorCodes.CapacityCanNotBeLowerThanRegisteredUserCount); } } diff --git a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs index 2938903..3d21a00 100644 --- a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs +++ b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs @@ -32,7 +32,7 @@ namespace EventHub.Events.Registrations var registrationCount = await _eventRegistrationRepository.CountAsync(x => x.EventId == @event.Id); - if (@event.Capacity != null && registrationCount >= @event.Capacity) + if (@event.Capacity != null && registrationCount >= @event.Capacity) { throw new BusinessException(EventHubErrorCodes.CapacityOfEventFull) .WithData("EventTitle", @event.Title);