Aaron I
✅ Reoccurring times with a possibility to a one time rep in C#
Suppose we have an entity which represents irl event, this event can reoccur every week or be one-time event. How should I manage it? currently my code is pretty disgusting I'm getting a boolean value
_reoccurring
which determines which type it is. Then, depends on the value I either assign the following properties accordingly:
It might be stupid and I'm missing something which makes it easier a lot more, but after digging SO for 30min I decided to come here.
There is separation between the two because I don't want a bound to a specific date when working on reoccurring time-events.
Another idea I thought of is using the same boolean prop (_reoccurring
), keep Start
and End
props and depends on _reoccurring
value I will ignore/ include the date that Start
and End
bound to. However, I don't know if it's a reasonable/proper solution.53 replies