/// <summary> /// Initializes a new instance of the <see cref="DIActorSystemAdapter"/> class. /// </summary> /// <param name="system">The actor system that contains the DI extension.</param> /// <exception cref="ArgumentNullException"> /// The <paramref name="system"/> was null. /// </exception> public DIActorSystemAdapter(ActorSystem system) { if (system == null) { throw new ArgumentNullException("system"); } this.system = system; this.producer = system.GetExtension <DIExt>(); }
/// <summary> /// Initializes a new instance of the <see cref="DIActorSystemAdapter"/> class. /// </summary> /// <param name="system">The actor system that contains the DI extension.</param> /// <exception cref="ArgumentNullException"> /// This exception is thrown when the specified <paramref name="system"/> is undefined. /// </exception> public DIActorSystemAdapter(ActorSystem system) { if (system == null) { throw new ArgumentNullException(nameof(system), $"DIActorSystemAdapter requires {nameof(system)} to be provided"); } this.system = system; this.producer = system.GetExtension <DIExt>(); }
public DIActorContextAdapter(IActorContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.context = context; this.producer = context.System.GetExtension <DIExt>(); }
/// <summary> /// Initializes a new instance of the <see cref="DIActorContextAdapter"/> class. /// </summary> /// <param name="context">The actor context associated with a system that contains the DI extension.</param> /// <exception cref="ArgumentNullException"> /// This exception is thrown when the specified <paramref name="context"/> is undefined. /// </exception> public DIActorContextAdapter(IActorContext context) { if (context == null) { throw new ArgumentNullException(nameof(context), $"DIActorContextAdapter requires {nameof(context)} to be provided"); } this.context = context; this.producer = context.System.GetExtension <DIExt>(); }
/// <summary> /// Initializes a new instance of the <see cref="DIActorSystemAdapter"/> class. /// </summary> /// <param name="system">The actor system that contains the DI extension.</param> /// <exception cref="ArgumentNullException"> /// This exception is thrown when the specified <paramref name="system"/> is undefined. /// </exception> /// <exception cref="InvalidOperationException"> /// This exception is thrown when the Dependency Resolver has not been configured in the <see cref="ActorSystem" />. /// </exception> public DIActorSystemAdapter(ActorSystem system) { if (system == null) { throw new ArgumentNullException(nameof(system), $"DIActorSystemAdapter requires {nameof(system)} to be provided"); } this.system = system; this.producer = system.GetExtension <DIExt>(); if (producer == null) { throw new InvalidOperationException("The Dependency Resolver has not been configured yet"); } }
/// <summary> /// Initializes a new instance of the <see cref="DIActorContextAdapter"/> class. /// </summary> /// <param name="context">The actor context associated with a system that contains the DI extension.</param> /// <exception cref="ArgumentNullException"> /// This exception is thrown when the specified <paramref name="context"/> is undefined. /// </exception> /// <exception cref="InvalidOperationException"> /// This exception is thrown when the Dependency Resolver has not been configured in the <see cref="ActorSystem" />. /// </exception> public DIActorContextAdapter(IActorContext context) { if (context == null) { throw new ArgumentNullException(nameof(context), $"DIActorContextAdapter requires {nameof(context)} to be provided"); } this.context = context; this.producer = context.System.GetExtension <DIExt>(); if (producer == null) { throw new InvalidOperationException("The Dependency Resolver has not been configured yet"); } }