See this article from EF Core docs.
When nullable reference types are enabled, the C# compiler emits warnings for any uninitialized non-nullable property, as these would contain null. As a result, the common practice of defining a non-nullable DbSet on a context will now generate a warning. However, EF Core always initializes all DbSet properties on DbContext-derived types, so they are guaranteed to never be null, even if the compiler is unaware of this.
There is a workaround mentioned in the docs to add = null!, but I feel it's reasonable to exclude any public DbSet that exists in a class derived from DbContext by default.
See this article from EF Core docs.
There is a workaround mentioned in the docs to add
= null!, but I feel it's reasonable to exclude any public DbSet that exists in a class derived from DbContext by default.