Skip to content

Blazor Deserialization error #11476

Closed
Closed
@Julien-Marpault

Description

@Julien-Marpault

With upgrade to .NEt core 3 review 6 I get a deserialization issue with date using HttpClient.GetJsonAsync() in Blazor

Here is the json:

{
    "id": 1,
    "priority": 2,
    "type": 1,
    "status": 3,
    "title": "Ralentissements importants lors de la consultation d'une fiche produit",
    "creationdate": "2019-06-11T00:00:00",
    "userId": 13
}

If I use this code:

Ticket = await Http.GetJsonAsync<TicketDetailsDto>($"api/tickets/{TicketId}");

The date is not deserialized correctly an I get a January 1st date

If I use this code:

HttpResponseMessage response = await Http.GetAsync($"api/tickets/{TicketId}");
string jsonString = await response.Content.ReadAsStringAsync();
Ticket = JsonConvert.DeserializeObject<TicketDetailsDto>(jsonString);

the date is correctly deserialized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions