public static string ToString(CarePlanStatus value) { if (value == CarePlanStatus.Planned) { return("planned"); } else if (value == CarePlanStatus.Active) { return("active"); } else if (value == CarePlanStatus.Ended) { return("ended"); } else { throw new ArgumentException("Unrecognized CarePlanStatus value: " + value.ToString()); } }
public static bool TryParse(string value, out CarePlanStatus result) { result = default(CarePlanStatus); if (value == "planned") { result = CarePlanStatus.Planned; } else if (value == "active") { result = CarePlanStatus.Active; } else if (value == "ended") { result = CarePlanStatus.Ended; } else { return(false); } return(true); }