public class Sample
{
public VehicleEnum Keyword { get;set;}
}
public enum VehicleEnum { CAR = 0 , BIKE = 1 };
object modelObject = Activator.CreateInstance("ModelAssembly", "ModelAssembly.Sample");
object propValue = modelObject.GetType().GetProperty("Keyword").GetValue(modelObject);
- Is there any way to return value in string data type(i.e. "Car").
- Is there anyway of getting the list of Enumeration values as list of strings (not only assigned value) i.e. In this case, {"CAR", "BIKE" }
Aucun commentaire:
Enregistrer un commentaire