public static IMiddlerOptionsBuilder AddUrlRewriteAction(this IMiddlerOptionsBuilder optionsBuilder, string alias = null) { alias = !String.IsNullOrWhiteSpace(alias) ? alias : UrlRewriteAction.DefaultActionType; optionsBuilder.ServiceCollection.AddTransient <UrlRewriteAction>(); optionsBuilder.RegisterAction <UrlRewriteAction>(alias); return(optionsBuilder); }
public static IMiddlerOptionsBuilder AddScriptingAction(this IMiddlerOptionsBuilder optionsBuilder, string alias = null) { alias = !String.IsNullOrWhiteSpace(alias) ? alias : ScriptingAction.DefaultActionType; optionsBuilder.ServiceCollection.AddTransient <ScriptingAction>(); optionsBuilder.RegisterAction <ScriptingAction>(alias); //Json.Converter.RegisterJsonConverter<PSObjectJsonConverter>(); return(optionsBuilder); }