internal ShortcodeOptions AddShortcodeDelegate(string name, ShortcodeDelegate shortcode, Action <ShortcodeOption> describe) { var option = new ShortcodeOption { Name = name }; describe?.Invoke(option); _shortcodes[name] = option; _shortcodeDelegates[name] = shortcode; return(this); }
public static IServiceCollection AddShortcode(this IServiceCollection services, string name, ShortcodeDelegate shortcode, Action <ShortcodeOption> describe) { services.Configure <ShortcodeOptions>(options => options.AddShortcodeDelegate(name, shortcode, describe)); return(services); }
public static IServiceCollection AddShortcode(this IServiceCollection services, string name, ShortcodeDelegate shortcode) => services.Configure <ShortcodeOptions>(options => options.AddShortcodeDelegate(name, shortcode, null));