The following code is from the official MS documentation; I followed as same for to solve this warning issues.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using MvcMovie.Models;
namespace MvcMovie.Data
{
public class MvcMovieContext : DbContext
{
public MvcMovieContext (DbContextOptions<MvcMovieContext> options)
: base(options)
{
}
public DbSet<MvcMovie.Models.Movie> Movie { get; set; }
}
}
3
Answers
In you MvcMovieContext class, instread that :
Simply do that :
And it’s done. Otherwise tell me if it doesn’t work.
in the document link you posted , you should have founnd this warning
"To eliminate the warnings from nullable reference types, REMOVE the following line from the MvcMovie.csproj file "
The best way remove this line in .csproj => Nullable enable Nullable
If you do like this :
It will Warning in other files