public static IApplicationBuilder UseMongoDbStorage(this IApplicationBuilder app) { using (var serviceScope = app.ApplicationServices.GetRequiredService <IServiceScopeFactory> ().CreateScope()) { PatchaWalletDbClient client = serviceScope.ServiceProvider.GetService <PatchaWalletDbClient> (); client.EnsureDatabaseCreated(); } return(app); }
public void Load_db_should() { MongoDbOptions mongoDbOptions = new MongoDbOptions() { Connection = "mongodb://localhost:27017", DatabaseId = "dpsp_unittests" }; var mockMongoDbOptions = new Mock <IOptions <MongoDbOptions> >(); mockMongoDbOptions.Setup(ap => ap.Value).Returns(mongoDbOptions); var repository = new PatchaWalletDbClient(mockMongoDbOptions.Object); }
public GetCoinTradeRequest(PatchaWalletDbClient client) { _client = client; }
public UpdateStockHandler(PatchaWalletDbClient client) { _client = client; }
public GetSingleStockHandler(PatchaWalletDbClient client) { _client = client; }
public GetQuoteHandler(PatchaWalletDbClient client) { _client = client; }
public GetStockTradeHandler(PatchaWalletDbClient client) { _client = client; }
public CreateStockTransactionHandler(PatchaWalletDbClient client) { _client = client; }
public GetSingleStockTransactionHandler(PatchaWalletDbClient client) { _client = client; }
public CheckExistsHandler(PatchaWalletDbClient client) { _client = client; }
public UpdateQuoteHandler(PatchaWalletDbClient client) { _client = client; }