forked from ddrilling/AsbCloudServer
Returning 'using' to ef context creation
This commit is contained in:
parent
e0a453a1f6
commit
2a4c76611c
@ -44,7 +44,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
|
var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
|
||||||
.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
|
.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
|
||||||
.Options;
|
.Options;
|
||||||
var db = new AsbCloudDbContext(options);
|
using var db = new AsbCloudDbContext(options);
|
||||||
|
|
||||||
var cacheTelemetry = cacheDb.GetCachedTable<Telemetry>(db);
|
var cacheTelemetry = cacheDb.GetCachedTable<Telemetry>(db);
|
||||||
var keyValuePairs = new Dictionary<string, TrackerStat>(cacheTelemetry.Count());
|
var keyValuePairs = new Dictionary<string, TrackerStat>(cacheTelemetry.Count());
|
||||||
|
Loading…
Reference in New Issue
Block a user