i have 2 int column in sql database one for month and one for year i want to query this against Database like this DateFrom is dateTime and also DateTo is DataTime
var result = GetAll().Where(x =>
(x.InvoiceMonth >= DateFrom.Month && x.InvoiceYear >= DateFrom.Year)
&&
(x.InvoiceMonth <= DateTo.Month && x.InvoiceYear <= DateTo.Year));
but the problem here if user sent 1/1/2021 to 1/1/2023
it will just return Jan 2021 and Jan 2022and Jan 2023
the correct return should return all things between 2 dates
You can construct the date with the data you have