Need DB II

This commit is contained in:
2023-02-08 09:42:52 -07:00
parent 7828493f27
commit 8c6a2d92db
4 changed files with 12 additions and 12 deletions

View File

@ -16,21 +16,21 @@ public class PinRepository : IPinRepository
_Log = Serilog.Log.ForContext<PinRepository>();
}
Result<HeaderCommond[]> IPinRepository.GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? bioRad, string? cde)
Result<Pinned[]> IPinRepository.GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? bioRad, string? cde)
{
Result<HeaderCommond[]>? r;
Result<Pinned[]>? r;
HeaderCommon? cdeHeader = cde is null ? null : JsonSerializer.Deserialize<HeaderCommon>(cde);
long cdeId = cdeHeader is null ? (long)IPinRepository.ToolId.CDE : cdeHeader.ToolTypeID;
HeaderCommon? bioRadHeader = bioRad is null ? null : JsonSerializer.Deserialize<HeaderCommon>(bioRad);
long bioRadId = bioRadHeader is null ? (long)IPinRepository.ToolId.BioRad : bioRadHeader.ToolTypeID;
if (cdeHeader is not null && cdeHeader.ToolTypeID != id && bioRadHeader?.ToolTypeID != id)
r = new() { Results = Array.Empty<HeaderCommond>(), TotalRows = 0 };
if (cdeId != id && bioRadId != id)
r = new() { Results = Array.Empty<Pinned>(), TotalRows = 0 };
else
{
if (!string.IsNullOrEmpty(_MockRoot))
{
string json = File.ReadAllText(Path.Combine(string.Concat(AppContext.BaseDirectory, _MockRoot), "GetPinnedTableApi.json"));
r = JsonSerializer.Deserialize<Result<HeaderCommond[]>>(json);
r = JsonSerializer.Deserialize<Result<Pinned[]>>(json);
if (r is null)
throw new NullReferenceException(nameof(r));
}
@ -39,8 +39,8 @@ public class PinRepository : IPinRepository
const int rows = 11;
List<string> values;
const int points = 9;
HeaderCommond headerCommond;
List<HeaderCommond> results = new();
Pinned headerCommond;
List<Pinned> results = new();
if (bioRadHeader is not null)
{
const int columns = 10;