In my project user can select 2 dates startDate
and endDate
. The selected startDate
must be greater than the largest endDate
stored in SQL Server:
How can I check this using an Entity Framework Linq statement?
_context.tableName.where(p => p.startDate >= ??);
CodePudding user response:
Something like this could work for you, adapt it to your needs
if (startDate > _context.tableName.Max(p => p.endDate))