Returning 'using' to ef context creation

This commit is contained in:
KharchenkoVladimir 2021-11-23 11:43:58 +05:00
parent e0a453a1f6
commit 2a4c76611c

View File

@ -44,7 +44,7 @@ namespace AsbCloudInfrastructure.Services
var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
.Options;
var db = new AsbCloudDbContext(options);
using var db = new AsbCloudDbContext(options);
var cacheTelemetry = cacheDb.GetCachedTable<Telemetry>(db);
var keyValuePairs = new Dictionary<string, TrackerStat>(cacheTelemetry.Count());