Let's say I have School model
public class School {
public string Name {get; set;} // property
}
I have a array list of Properties coming from database
var arraylist = ["ComputerParts","CellphoneParts"]
is there a way that can I add new property in School Model using for loop?
this what i'm thinking
- for loop arraylist
- Add new property in school model
//add this -> public string ComputerParts{get; set;} -> in school model
// add this -> public string CellphoneParts {get; set;} -> in school model
Here's the expected result
public class School {
public string Name {get; set;}
public string ComputerParts{get; set;}
public string CellphoneParts {get; set;}
}