This smells like a scoping issue with my variable however moving it does not seem to help. Here is a very simple example. I create the currentDay variable. I set it's value. I then call another method which should change the value of currentDay, but it never changes. Just Monday morning blindness?
void Main()
{
SetScheduleTicketsDate();
}
public static void SetScheduleTicketsDate()
{
DateTime currentDay = DateTime.Now;
SchedulePatchGroup(currentDay);
Console.WriteLine(currentDay);
}
private static void SchedulePatchGroup(DateTime currentDay)
{
currentDay = currentDay.AddDays(10);
}
return currentDay.AddDays(10);?DateTimeis a value-type, not a reference type.