/// <summary> /// Default runtime factory /// </summary> /// <returns>Runtime</returns> public static async Task <TutorialRuntime> UseInMemory() { var persistence = await PersistenceFactory.CreateInMemoryAsync(); var snapshots = await PersistenceFactory.CreateInMemoryAsync(); var runtime = new TutorialRuntime(persistence, snapshots); return(runtime); }
static async Task Main(string[] args) { TutorialRuntime.Initializer = () => TutorialRuntime.UseSqlServer( "Server=localhost;Database=NStore;User Id=sa;Password=MsSqlDock3r;" ); // Persistence await new T00_Persistence_Append().ShowAsync(); await new T01_Persistence_Append_with_idempotency().ShowAsync(); // Streams await new T01_Stream_Create_Read_Update_Delete().ShowAsync(); // Aggregates await new T10_Aggregate_Create_Read_Update().ShowAsync(); await new T11_Aggregate_Delete().ShowAsync(); }
public static async Task <TutorialRuntime> UseSqlServer(string connectionString) { var persistence = await PersistenceFactory.CreateSqlServerAsync ( connectionString, "streams", NStoreNullLoggerFactory.Instance ); var snapshots = await PersistenceFactory.CreateSqlServerAsync ( connectionString, "snapshots", NStoreNullLoggerFactory.Instance ); var runtime = new TutorialRuntime(persistence, snapshots); return(runtime); }