I have:
public class Schedule
{
public List<DateTime> Dates {get; set;}
// Some methods
}
I'd like Schedule to behave as List:
var date = Schedule[idx];
dates = List<DateTime>;
Schedule = dates;
dates = Schedule;
...
Schedule should be a list of Dates as it is in reality, by adding a member Dates, it feels like a computer object, adding a layer of abstraction and moving away from the modeled object.
There are 2 possibilities but they are not perfect:
Overloading operators (e.g. "[]") but "="can't be overloaded.
Alias with "using" but it won't have any method.
For example, in C++, I would have overloaded the operators and keep a private member _dates.
Thanks