/// <summary> /// Add Marten IDocumentStore, IDocumentSession, and IQuerySession service registrations /// to your application with the given Postgresql connection string and Marten /// defaults /// </summary> /// <param name="services"></param> /// <param name="connectionString">The connection string to your application's Postgresql database</param> /// <returns></returns> public static MartenConfigurationExpression AddMarten(this IServiceCollection services, string connectionString) { var options = new StoreOptions(); options.Connection(connectionString); return(services.AddMarten(options)); }
// build out the StoreOptions that you need for your application private static StoreOptions configureStoreOptions() { var options = new StoreOptions(); options.Schema.For<User>(); options.Schema.For<Issue>(); options.Schema.For<Target>(); options.Connection(ConnectionSource.ConnectionString); return options; }