public QueueService([FromServices] IQueueFactory factory) { if (factory == null) { throw new InvalidOperationException($"Could not resolve {nameof(factory)} type from DI container."); } var channel = factory.CreateChannel(); if (!channel.IsOpen) { throw new InvalidOperationException($"Channel were not previously conected."); } this._channel = channel; this._properties = this._channel.CreateBasicProperties(); this._address = new PublicationAddress(string.Empty, string.Empty, string.Empty); }