c# the value date is not valid for datetime code example
Example: The value '26/10/2020' is not valid for Date.
public void ConfigureServices(IServiceCollection services)
{
var cultureInfo = new CultureInfo("pt-BR");
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;