I have a model that the API backend is expected that period could ethier be a string like "today","yesterday",etc
Or it could be a List<int>
like "[9292,8383]","[8891,9333]"
internal class CallHistoryModel
{
public string period { get; set; }
}
Similar to how you can create a method override using the same name with different parameters is it possible to create either a class override or variable override.
Keeping the same name is important because the class is converted to json when it is sent to the server
To provide more context I know that I can do something like
public class CallHistoryModel<T>
{
public T period { get; set; }
public CallHistoryModel(T _period)
{
period = _period;
}
}
However period is not a required parameter that will always be sent and my question is wondering if there is a better alternative that the user would not have to specify the type unless it is being used