/// <summary> /// The update. /// </summary> /// <param name="haveComponentRegistry"> /// The have component registry. /// </param> /// <param name="containerBuilder"> /// The container builder. /// </param> public static void UpdateRegistry( [NotNull] this IHaveComponentRegistry haveComponentRegistry, [NotNull] ContainerBuilder containerBuilder) { CodeContracts.VerifyNotNull(haveComponentRegistry, "haveComponentRegistry"); CodeContracts.VerifyNotNull(containerBuilder, "containerBuilder"); containerBuilder.Update(haveComponentRegistry.ComponentRegistry); }
/// <summary> /// The is registered. /// </summary> /// <param name="haveComponentRegistry"> /// The have component registry. /// </param> /// <param name="registeredType"></param> /// <returns> /// The is registered. /// </returns> public static bool IsRegistered([NotNull] this IHaveComponentRegistry haveComponentRegistry, Type registeredType) { CodeContracts.VerifyNotNull(haveComponentRegistry, "haveComponentRegistry"); return(haveComponentRegistry.ComponentRegistry.IsRegistered(new TypedService(registeredType))); }
/// <summary> /// Is not registered in the component registry. /// </summary> /// <param name="haveComponentRegistry"> /// The have component registry. /// </param> /// <typeparam name="TRegistered"> /// </typeparam> /// <returns> /// The is registered. /// </returns> public static bool IsNotRegistered <TRegistered>([NotNull] this IHaveComponentRegistry haveComponentRegistry) { CodeContracts.VerifyNotNull(haveComponentRegistry, "haveComponentRegistry"); return(!haveComponentRegistry.ComponentRegistry.IsRegistered(new TypedService(typeof(TRegistered)))); }
/// <summary> /// The is registered. /// </summary> /// <param name="haveComponentRegistry"> /// The have component registry. /// </param> /// <typeparam name="TRegistered"> /// </typeparam> /// <returns> /// The is registered. /// </returns> public static bool IsRegistered <TRegistered>([NotNull] this IHaveComponentRegistry haveComponentRegistry, string named) { CodeContracts.VerifyNotNull(haveComponentRegistry, "haveComponentRegistry"); return(haveComponentRegistry.ComponentRegistry.IsRegistered(new KeyedService(named, typeof(TRegistered)))); }