I have a entity object in c#. It queries a database table called FBApi. The table stores an integer year and integer month. I have function that needs to return all records greater than the passed in parameters.
public query(int myYear, int myMonth){
var context = new MCSSUtility.Entities();
return context.FBApis.Where(p => p.month == month && p.year == year);
}
I was thinking of converting the integers to a DateTime object, but i am not sure how to dynamically convert the where clause to Datetime variable?
public query(int myYear, int myMonth){
DateTime my = new DateTime(myYear,myMonth,1);
var context = new MCSSUtility.Entities();
return context.FBApis.Where(p => new DateTime(p.year,p.month,1) >= my);
}