I have a requirement to store various types of fields in Db. I have base field class with all common property and I have derived classes with specific properties for each field type.
public class BaseField
{
public string ID{get;set;}
public string Name{get;set;}
}
public class CheckboxField:BaseField
{
public bool Checked{get;set;}
}
I have an asp.net core web API method that accepts BaseField as a parameter. When I try to save an object of type CheckboxField it is always converted BaseField. I know that as the parameter is of type BaseField, it is always serializing to BaseField but I want to know how can I handle saving checkbox field using the same method.