A free and open-source web framework that enables developers to create web apps using C# and HTML, developed by Microsoft.
Hi @sblb ,
int close = context.Developers.Count(a => a.DateSolde.Month == DateTime.Today.Month);The problem is that when I put DateTime? DateSolde I've the does not include a month definition.
Since the DateSolde property is nullable, before the Count method, add a ToList() method, and for the DateSolde property, add a ? character, like this:
int close = context.Developers.ToList().Count(a => a.DateSolde?.Month == DateTime.Today.Month);
The result as below:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion