'DbContextOptionsBuilderExtensions.ReadDateTimeAsUtc is obsolete: 'For .NET 5.0 or greater use UtcDateTimeAnnotation

     options.WithWarnings()
    .AddDefaultRelationalRunTimeWarnings()
    .ConfigureWarnings()
    .ConfigureWarnings(o => o.Ignore(Microsoft.EntityFrameworkCore.Diagnostics.
RelationalEventId.ValueConversionSqlLiteralWarning))
    .ReadDateTimeAsUtc()
    .UseNpgsql(connectionString, builder =>
    {
    builder.MigrationsHistoryTable(MIGRATION_HISTORY_TABLE_NAME,RmaClaimStorageDbContext.DB_SCHEMA_NAME);
    });
       }); 

I have code above, updated project from .net core 2.2 to .net 5 and now getting error that above code is obsolete. How to update this code using UtcDateTimeAnnotation.ApplyUtcDateTimeConverter? Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source