In my database I have a table holding some subscription information. I have among others a StartDate and an EndDate as DateTime.
What I need is to make a Linq query getting all rows due for payment. The payment is supposed to take place each month on the same day they registered (StartDate) and stop on the EndDate. So if they registered on the 23. May, I need to invoice them again 23. June, 23. July and so on.
var query = from c in db.Subscription
where c.StartDate.Value.Day == DateTime.Now.Day
// What if today is Feb. 28 and a customer registered January 31.
// What if....
I am lost...please help!
Best, Jon 2H