/// <summary> /// Adds the registered IEventLogger instance to the repository builder. /// </summary> public static IRepositoryBuilder UseLogger(this IRepositoryBuilder repositoryBuilder, IServiceProvider provider) { var logger = provider.GetService <IEventLogger>(); if (logger != null) { repositoryBuilder.UseLogger(logger); } // stores a logger instance for later use var genericLogger = provider.GetService <ILogger <SnILogger> >(); if (genericLogger != null) { repositoryBuilder.SetProvider <ILogger <SnILogger> >(genericLogger); } return(repositoryBuilder); }
/// <summary> /// General API for defining a provider instance that will be injected into and can be loaded /// from the Providers.Instance store. /// </summary> /// <param name="repositoryBuilder"></param> /// <param name="provider">Provider instance.</param> public static IRepositoryBuilder UseProvider(this IRepositoryBuilder repositoryBuilder, object provider) { repositoryBuilder.SetProvider(provider); return(repositoryBuilder); }