public JsonResult GetEatingGuideDetail(int id, string langCode) { var result = BlEatingGuideDetail.GetAll().Where(x => x.HeadId == id && x.LangCode == langCode).Select(x => new { x.HeadId, x.FoodCode, x.FoodDescription, BlFoodGroup.GetAll().FirstOrDefault(p => p.ID == x.FoodGroupID && p.LangCode == langCode).FoodGroupDescription, BlSection.GetAll().FirstOrDefault(p => p.ID == x.SectionID && p.LangCode == langCode).SectionDescription, x.LangCode, x.Quantity_MeasurementUnitCode, x.Quantity, QuantityDesc = $"{x.Quantity} {x.Quantity_MeasurementUnitCode}", x.Calories, x.Carbs, x.Protein, x.Fat }); return(Json(result)); }
public JsonResult GetFoodGroupsByLanguage(string langCode) { var obj = BlFoodGroup.GetAll().Where(x => x.LangCode == langCode); return(Json(obj)); }
public JsonResult GetFoodGroups() { var obj = BlFoodGroup.GetAll(); return(Json(obj)); }