public static TypeHasDefaultConstructor ( |
||
type | ||
argumentName | [ | |
리턴 | void |
/// <summary> /// Defines a custom builder to use. /// </summary> /// <param name="definitionType">The type of the <see cref="ContainerDefinition" />.</param> public void UseContainer(Type definitionType) { Guard.AgainstNull(nameof(definitionType), definitionType); Guard.TypeHasDefaultConstructor(definitionType, nameof(definitionType)); Settings.Get <HostingComponent.Settings>().CustomObjectBuilder = definitionType.Construct <ContainerDefinition>().CreateContainer(Settings); }
/// <summary> /// Defines a custom builder to use. /// </summary> /// <param name="definitionType">The type of the <see cref="ContainerDefinition" />.</param> public void UseContainer(Type definitionType) { Guard.AgainstNull(nameof(definitionType), definitionType); Guard.TypeHasDefaultConstructor(definitionType, nameof(definitionType)); UseContainer(definitionType.Construct <ContainerDefinition>().CreateContainer(Settings)); }
/// <summary> /// Defines a custom builder to use. /// </summary> /// <param name="definitionType">The type of the <see cref="ContainerDefinition" />.</param> public void UseContainer(Type definitionType) { Guard.AgainstNull(nameof(definitionType), definitionType); Guard.TypeHasDefaultConstructor(definitionType, nameof(definitionType)); ContainerComponent.UseContainer(definitionType); }
/// <summary> /// Configures NServiceBus to use the given transport. /// </summary> public static TransportExtensions UseTransport(this BusConfiguration busConfiguration, Type transportDefinitionType) { Guard.TypeHasDefaultConstructor(transportDefinitionType, "transportDefinitionType"); busConfiguration.Settings.Set(TransportDefinitionTypeKey, transportDefinitionType); return(new TransportExtensions(busConfiguration.Settings)); }
/// <summary> /// Configures NServiceBus to use the given transport. /// </summary> public static TransportExtensions UseTransport(this EndpointConfiguration endpointConfiguration, Type transportDefinitionType) { Guard.AgainstNull(nameof(endpointConfiguration), endpointConfiguration); Guard.AgainstNull(nameof(transportDefinitionType), transportDefinitionType); Guard.TypeHasDefaultConstructor(transportDefinitionType, nameof(transportDefinitionType)); var transportDefinition = transportDefinitionType.Construct <TransportDefinition>(); ConfigureTransport(endpointConfiguration, transportDefinition); return(new TransportExtensions(endpointConfiguration.Settings)); }
/// <summary> /// Defines a custom builder to use /// </summary> /// <param name="definitionType">The type of the builder</param> public void UseContainer(Type definitionType) { Guard.TypeHasDefaultConstructor(definitionType, "definitionType"); UseContainer(definitionType.Construct <ContainerDefinition>().CreateContainer(Settings)); }