I am having this problem with not getting my data as is described in detail here: https://www.pmichaels.net/2020/02/22/my-object-wont-deserialise-using-system-text-json/
using System.Text.Json
using System.Text.Json.Serialization;
private List<RecordDetail> recordDetails;
var httpClient = _clientFactory.CreateClient("ServerAPI");
httpClient.DefaultRequestHeaders.Add("Accept", "application/json");
var json = JsonSerializer.Serialize(recordDetails);
var content = new StringContent(json);
string errorMessage = null;
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
HttpResponseMessage response = await httpClient.GetAsync($"{baseUrl}/api/Record/DetailByClient/22/49/3");
string dtls = await response.Content.ReadAsStringAsync();
if (dtls is not null)
{
var **recordDetails** = JsonSerializer.Deserialize(dtls, typeof(List<RecordDetail>)) as List<RecordDetail>;
}
dtls looks like this:
[{"TransactionId":1015,"CName":"Don","TDate":"May 9 2020 4:54PM","BDate":"May 9 2020 4:54PM","Initials":"JMC","IsBilled":false,"IsPaid":false,"SvcLevel":"R1"},{"TransactionId":988,"CName":"D n","TDate":"Jan 23 2020 3:13PM","BDate":"Mar 10 2020 11:17AM","Initials":"JMC","IsBilled":false,"IsPaid":false,"SvcLevel":"R1"},{"TransactionId":974,"CName":"Don","TDate":"Jan 22 2020 2:36PM","BDate":"Jan 22 2020 2:36PM","Initials":"JMC","IsBilled":false,"IsPaid":false,"SvcLevel":"R1"}]
RecordDetail.cs:
public class RecordDetail
{
public int TransactionId { get; set; }
public string CName { get; set; }
public string TDate { get; set; }
public string BDate { get; set; }
public string Initials { get; set; }
public bool IsBilled { get; set; }
public bool IsPaid { get; set; }
public string SvcLevel { get; set; }
}

Without the options added to Deserialize I am seeing the exact same thing as described in the post I linked to.
What am I doing wrong here?
Then, with a different notation var recordDetails = JsonSerializer.Deserialize<RecordDetail>(dtls, options);
The JSON value could not be converted to BtServer.Pages.RecordDetail. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
Same question, what am I doing wrong here?
