/// <summary>
 /// Uses the dependency context.
 /// </summary>
 /// <param name="builder">The builder.</param>
 /// <param name="dependencyContext">The dependency context.</param>
 /// <param name="diagnosticSource">The diagnostic source.</param>
 /// <returns>IRocketHostBuilder.</returns>
 public static IRocketHostBuilder UseDependencyContext(
     this IRocketHostBuilder builder,
     DependencyContext dependencyContext,
     DiagnosticSource diagnosticSource = null)
 {
     return(RocketBooster.ForDependencyContext(dependencyContext, diagnosticSource)(builder.Builder));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Uses the dependency context.
        /// </summary>
        /// <param name="builder">The builder.</param>
        /// <param name="dependencyContext">The dependency context.</param>
        /// <param name="diagnosticSource">The diagnostic source.</param>
        /// <returns>IRocketHostBuilder.</returns>
        public static IRocketHostBuilder UseDependencyContext(
            [NotNull] this IRocketHostBuilder builder,
            [NotNull] DependencyContext dependencyContext,
            DiagnosticSource?diagnosticSource = null
            )
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (dependencyContext == null)
            {
                throw new ArgumentNullException(nameof(dependencyContext));
            }

            return(RocketBooster.ForDependencyContext(dependencyContext, diagnosticSource)(builder.Builder));
        }