SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
When you have fields in a table that may contain null values, it's better to clarify this in your .NET Core model.
For example, you can denote nullable fields using the ? character, like so:
public int? RefID { get; set; }
However, when I ran my program, it showed an error due to many fields being null. I resolved this issue by adding the following lines to the <PropertyGroup> in the project file:
<PropertyGroup>
<Nullable>warnings</Nullable>
</PropertyGroup>
This modification configures how the compiler handles nullability, helping to prevent errors related to null handling in .NET Core projects.
سلام لیلاجان خوبی؟ فاطمه احمدی هستم. گوشیم ریست شده چند وقته ازت خبر ندارم.