Ejemplo n.º 1
0
 /// <summary>
 /// Registers <see cref="WebHookStore{TContext}"/> as <see cref="IWebHookStore"/> and <see cref="WebHookRegistrationStore{TContext}"/> as <see cref="IWebHookRegistrationStore"/>.
 /// TWebHookTriggerProvider is registered as singleton
 /// </summary>
 /// <typeparam name="TContext"></typeparam>
 /// <typeparam name="TWebHookTriggerProvider"></typeparam>
 /// <param name="harpoon"></param>
 /// <returns></returns>
 public static IHarpoonBuilder RegisterWebHooksUsingEfStorage <TContext, TWebHookTriggerProvider>(this IHarpoonBuilder harpoon)
     where TContext : DbContext, IRegistrationsContext
     where TWebHookTriggerProvider : class, IWebHookTriggerProvider
 {
     harpoon.Services.TryAddSingleton <IWebHookTriggerProvider, TWebHookTriggerProvider>();
     return(harpoon.RegisterWebHooksUsingEfStorage <TContext>());
 }
 /// <summary>
 /// Registers <see cref="WebHookStore{TContext}"/> as <see cref="IWebHookStore"/> and <see cref="WebHookRegistrationStore{TContext}"/> as <see cref="IWebHookRegistrationStore"/>.
 /// TWebHookTriggerProvider needs to be configured.
 /// </summary>
 /// <typeparam name="TContext"></typeparam>
 /// <param name="harpoon"></param>
 /// <returns></returns>
 public static IHarpoonBuilder RegisterWebHooksUsingEfStorage <TContext>(this IHarpoonBuilder harpoon)
     where TContext : DbContext, IRegistrationsContext
 => harpoon.RegisterWebHooksUsingEfStorage <TContext>(b => { });
 /// <summary>
 /// Registers <see cref="WebHookStore{TContext}"/> as <see cref="IWebHookStore"/> and <see cref="WebHookRegistrationStore{TContext}"/> as <see cref="IWebHookRegistrationStore"/>.
 /// TWebHookTriggerProvider is registered as singleton
 /// </summary>
 /// <typeparam name="TContext"></typeparam>
 /// <typeparam name="TWebHookTriggerProvider"></typeparam>
 /// <param name="harpoon"></param>
 /// <returns></returns>
 public static IHarpoonBuilder RegisterWebHooksUsingEfStorage <TContext, TWebHookTriggerProvider>(this IHarpoonBuilder harpoon)
     where TContext : DbContext, IRegistrationsContext
     where TWebHookTriggerProvider : class, IWebHookTriggerProvider
 => harpoon.RegisterWebHooksUsingEfStorage <TContext, TWebHookTriggerProvider>(b => { });