public IEnumerable <Models.SelectOption> Definitions(string definitionType) { Enum.TryParse(definitionType, out Models.DefinitionTypes defType); switch (defType) { case Models.DefinitionTypes.FlatType: return(EnumHelper.ConvertEnumToSelectList <FlatType>()); case Models.DefinitionTypes.NumberOfRooms: return(new List <Models.SelectOption> { new Models.SelectOption(1, "2"), new Models.SelectOption(2, "3") }); default: throw new ArgumentException($"Value {definitionType} is not supported definition type"); } }