19 using System.Collections.Generic;
28 private readonly Func<DateTime, DateTime, IEnumerable<DateTime>> _getDatesFunction;
35 public FuncDateRule(
string name, Func<DateTime, DateTime, IEnumerable<DateTime>> getDatesFunction)
38 _getDatesFunction = getDatesFunction;
49 if (!getDatesFunction.TryConvertToDelegate(out _getDatesFunction))
51 throw new ArgumentException(
"Python DateRule provided is not a function");
69 public IEnumerable<DateTime>
GetDates(DateTime start, DateTime end)
71 return _getDatesFunction(start, end);