skip to Main Content

c# JsonConvert.SerializeObject is updating the date

I am trying to remove all indentation from my json : "date": { "start": "2020-10-23T15:30:00+00:00" } I tried with this var freeContent = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(content)); But I got "date": {"start": "2020-10-23T13:30:00+00:00"} As you can see, the date is modified while I…

VIEW QUESTION

Asp.net – How to use "TypedHttpClientFactory" with "AddHttpMessageHandler"?

I have some AuthorizationHandler that I register with a typed client: var clientFactory = services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>(); services.AddHttpClient<TypedClient>() .AddHttpMessageHandler(() => { var authorization = new BearerAuthorization(clientFactory, clientId, clientSecret, authHost, token); return new AuthorizationHandler(authorization); }); When I get the "TypedClient" directly through the…

VIEW QUESTION

Javascript – aspnet form binding issue with nodatime and input local-datetime

I have binding issue between NodaTime and aspnet when using LocalDateTime Here is a sample razor pages app : Project.csproj <ItemGroup> <PackageReference Include="NodaTime" Version="3.1.12" /> <PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.2.0" /> </ItemGroup> Program.cs builder.Services.AddRazorPages() .AddJsonOptions(o => o.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb)); Index.cs public class IndexModel :…

VIEW QUESTION
Back To Top
Search