/// <summary>
 ///     Adds a mailer history store of the specified HistoryContext.
 /// </summary>
 /// <typeparam name="TContext">The type of the History DbContext.</typeparam>
 /// <param name="services">The services collection.</param>
 /// <param name="entityHistorySettings">The entity history settings.</param>
 /// <returns>IServiceCollection.</returns>
 public static IServiceCollection AddMailerHistory <TContext>(
     this IServiceCollection services,
     EntityHistoryStoreSettings entityHistorySettings)
     where TContext : HistoryContext
 {
     services.AddSingleton(entityHistorySettings);
     services.AddSingleton <IHistoryStore, EntityHistoryStore <TContext> >();
     return(services);
 }
 /// <summary>
 ///     Creates an instance of the EntityHistoryStore
 /// </summary>
 /// <param name="settings">The history store settings.</param>
 /// <param name="logger">An optional logger.</param>
 public EntityHistoryStore(EntityHistoryStoreSettings settings,
                           ILogger <EntityHistoryStore <TContext> > logger = null)
 {
     Settings = settings;
     Logger   = (ILogger)logger ?? NullLogger.Instance;
 }