❔ ✅ Quick question on classes, intellisense, non-nullable fields
I'm using projection in a LINQ query to select fields to create DTOs:
If I comment out any of these fields, there is no intellisense telling me that I'm omitting required fields and that field ends up just being null. Why is this the case and how can I get this functionality? I don't want to accidentally miss creating required fields in the future.
DTOs:
3 Replies
update to C#11 and use
required
keyword instead of [Required]
annotation I guess
->
thank you! looks like this works
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.