How to convert model class into dynamic controls in the view without a loop? I want to create if checkbox than show checkbox control if dropdown than show dropdown if text than create textbox.
public class DataSources
{
public int Id { get; set; }
[DisplayName("text")]
public string Name { get; set; }
[DisplayName("text")]
public string Phone { get; set; }
[DisplayName("checkbox")]
public bool Active { get; set; }
[DisplayName("dropdown")]
//[Column(TypeName = "dropdown")]
public List<DataSources> MyList { get; set; }
}