Hi,
I’m trying to avoid using a base class BaseStepTypeDto on the JobStepDto.StepParameters for the summarised structure below. The client is the TypeScript JsonServiceClient. A job can contain multiple steps and each step can have different parameters based on the step type. I could just stringify the step parameters but would like to get the type info if possible. Suggestions appreciated.
Thanks,
John
public class JobDto
{
public List<JobStepDto> JobSteps { get; set; } = new List<JobStepDto>();
}
public class JobStepDto
{
public JobStepType StepType { get; set; }
public BaseStepTypeDto StepParameters { get; set; }
}
public abstract class BaseStepTypeDto
{
public string Name { get; set; }
}
public class SomeOtherStepTypeDto : BaseStepTypeDto
{
//Lots of different config parameters
public string Config1 { get; set; }
}