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);
        }
Exemple #3
0
 public GetCoinTradeRequest(PatchaWalletDbClient client)
 {
     _client = client;
 }
Exemple #4
0
 public UpdateStockHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
 public GetSingleStockHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
 public GetQuoteHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
Exemple #7
0
 public GetStockTradeHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
 public CreateStockTransactionHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
Exemple #9
0
 public GetSingleStockTransactionHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
 public CheckExistsHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }
 public UpdateQuoteHandler(PatchaWalletDbClient client)
 {
     _client = client;
 }