Created
May 17, 2017 11:29
-
-
Save dmitry-zaets/d711ac8f3d6d193c6a9bbe3ef6bdf985 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Configure<TOptions>(this ContainerBuilder builder, Action<TOptions> configureOptions) where TOptions : class | |
{ | |
if (builder == null) | |
{ | |
throw new ArgumentNullException(nameof(builder)); | |
} | |
if (configureOptions == null) | |
{ | |
throw new ArgumentNullException(nameof(configureOptions)); | |
} | |
builder.RegisterInstance(new ConfigureOptions<TOptions>(configureOptions)) | |
.As<IConfigureOptions<TOptions>>() | |
.SingleInstance(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment