From c43527c4f4fe0d1630b971765507ccd46e7ed875 Mon Sep 17 00:00:00 2001 From: Berkan Date: Tue, 2 Feb 2021 15:34:07 +0300 Subject: [PATCH] Clock service removed from ctor injection --- .../Events/Registrations/EventRegistrationManager.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs index 419e8b1..3d7b169 100644 --- a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs +++ b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs @@ -11,14 +11,10 @@ namespace EventHub.Events.Registrations public class EventRegistrationManager : DomainService { private readonly IRepository _eventRegistrationRepository; - private readonly IClock _clock; - public EventRegistrationManager( - IRepository eventRegistrationRepository, - IClock clock) + public EventRegistrationManager(IRepository eventRegistrationRepository) { _eventRegistrationRepository = eventRegistrationRepository; - _clock = clock; } public async Task RegisterAsync( @@ -62,7 +58,7 @@ namespace EventHub.Events.Registrations private void CheckEventEndTime(Event @event) { - if (_clock.Now > @event.EndTime) + if (Clock.Now > @event.EndTime) { throw new BusinessException(EventHubErrorCodes.CantRegisterOrUnregisterForAPastEvent); }