c# - Compare two dates without a year -
i compare 2 dates excluding years.
ex.
input: fromdate: 01 march, todate: 05 march
then records between these 2 dates should come whether there year. not matter.
so please can me in issue.
thanks in advance.
if using linq , want create list querying db this?
public ienumerable<item> withintimerange(datetime begin, datetime end) { var items = in context.items a.timestamp.month.equals(begin.month) && a.timestamp.day >= begin.day && a.timestamp.month.equals(end.month) && a.timestamp.day <= end.day select a; return items.tolist(); }
personally create method in repository.
Comments
Post a Comment