Flip ITrackService/TrackManager to DTO output; TrackConverter is the sole entity<->DTO path across all consumers

This commit is contained in:
Daniel Harvey
2026-05-25 11:35:04 -04:00
parent 81fc87391b
commit 4351302a25
23 changed files with 156 additions and 156 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
using DeepDrftModels.Entities;
using DeepDrftModels.DTOs;
using Models.Common;
using NetBlocks.Models;
using System.Text.Json;
@@ -16,7 +16,7 @@ public class TrackClient
_http = httpClientFactory.CreateClient("DeepDrft.API");
}
public async Task<ApiResult<PagedResult<TrackEntity>>> GetPage(
public async Task<ApiResult<PagedResult<TrackDto>>> GetPage(
int pageNumber,
int pageSize,
string? sortColumn = null,
@@ -38,11 +38,11 @@ public class TrackClient
var response = await _http.GetAsync($"api/track/page{query}");
var json = await response.Content.ReadAsStringAsync();
var dto = JsonSerializer.Deserialize<ApiResultDto<PagedResult<TrackEntity>>>(json, new JsonSerializerOptions
var dto = JsonSerializer.Deserialize<ApiResultDto<PagedResult<TrackDto>>>(json, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
return dto?.From() ?? ApiResult<PagedResult<TrackEntity>>.CreateFailResult("Failed to deserialize response");
return dto?.From() ?? ApiResult<PagedResult<TrackDto>>.CreateFailResult("Failed to deserialize response");
}
}