This is my code
obj.Category = _db.Category.FirstOrDefault(u => u.Id == obj.CategoryId);
it will have CS8601: Possible null reference assignment
how to fix this one or how to avoid this type of warning in visual studio 2022 using the C#10
This is my code
obj.Category = _db.Category.FirstOrDefault(u => u.Id == obj.CategoryId);
it will have CS8601: Possible null reference assignment
how to fix this one or how to avoid this type of warning in visual studio 2022 using the C#10
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jun 30, 2022, 3:52 AM EDT