public HeartbeatLoggingConfiguration Repository(IHeartbeatLoggingRepository repository) { if (repository == null) { throw new ArgumentNullException(nameof(repository)); } Heartbeat.LiteServer.Application.Services(services => services .Advanced(advanced => advanced.Register(kernel => repository))); return(this); }
public HeartbeatLoggingWorker(IHeartbeatProvider[] providers, TimeSpan interval, IHeartbeatLoggingRepository repository) { if (providers == null) { throw new ArgumentNullException(nameof(providers)); } if (providers.Length == 0) { throw new ArgumentException(@"Value cannot be an empty collection.", nameof(providers)); } if (interval <= TimeSpan.Zero) { throw new ArgumentOutOfRangeException(nameof(interval), interval, @"Value cannot be zero or negative."); } if (repository == null) { throw new ArgumentNullException(nameof(repository)); } _providers = providers; _interval = interval; _repository = repository; }