I\'m working on an application where one can get information on movies from a database as well as add, update and delete the movies. In the database I have three tables (Movie,
This error happens immediately after I enabled C# 8 nullable feature in my Entity Framework Core 3.1 project.
The solution is to change your entity properties to their nullable counterparts. For example,
Change from:
public class Person {
public int Id { get; set; }
public string Name { get;set; }
public string Address { get;set; }
}
To:
public class Person {
public int Id { get; set; }
public string Name { get;set; }
public string? Address { get;set; } //change address to nullable string since it is nullable in database
}