Non-Nullable Property Must Contain A Non-Null Value

Solution 1:

I'm assuming you have nullable reference types enabled. There's a number of ways you can deal with this.

  1. Explicitly initialize those properties to the default or a known value.
    public class SomeType
    {
        public string SomeProperty { get; set; } = default!;
    }
    
  2. Disable nullable reference types for the entire file or section.
    #nullable disable // at the top of the file
    
    #nullable restore // after the block of code you wanted to temporarily disable
    
  3. Disable nullable reference types for the entire project.
    Remove or change the <Nullable> setting in your project file. (It defaults to enabled in .NET 6)

I would try to stick to #1 exclusively. Leave #3 alone if the intention is to make the transition.