private static void InitializeModel(DishViewModel model, Consistency consistency, Models.Type type) { model.DishTypes = new List <Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>(); model.ConsistencyTypes = new List <Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>(); var types = EnumUtil.EnumToList <Models.Type>(Convert.ToInt32(type)); model.DishTypes.AddRange(types); var consistencyTypes = EnumUtil.EnumToList <Models.Consistency>(Convert.ToInt32(consistency)); model.ConsistencyTypes.AddRange(consistencyTypes); }