public void Load(CardId left, CardId middle, CardId right, FoodId food) { SetCard(left, 0); SetCard(middle, 1); SetCard(right, 2); SetFood(food); }
public FoodModel GetFoodById(FoodId foodId) { FoodModel foodModel = new FoodModel(); using (ISession session = NHibernateSession.OpenSession()) // Open a session to conect to the database { var food = session.Query <Food>().FirstOrDefault(c => c.FoodId == foodId.Value); if (food != null) { foodModel = food.ToFoodModel(); } } return(foodModel); }
public List <(string, string)> GetParameters(bool isPremier) { var headers = new List <(string, string)>(); headers.Add(("method", _method)); headers.Add(("food_id", FoodId.ToString())); if (!isPremier) { return(headers); } headers.Add(("flag_default_serving", FlagDefaultServing.ToString())); headers.Add(("include_sub_categories", IncludeSubCategories.ToString())); return(headers); }
public JObject Get() { var lines = System.IO.File.ReadAllLines("FoodTable.txt"); FoodId[] foodTable = new FoodId[lines.Length]; for (int i = 0; i < lines.Length; i++) { string[] tokens = lines[i].Split("||"); string address = tokens[0]; int id = int.Parse(tokens[1]); string name = tokens[2]; foodTable[i] = new FoodId(address, id, name); } return(JObject.Parse("{ FoodItems: " + JsonConvert.SerializeObject(foodTable) + " }")); }
public static FoodData Find(FoodId id) => list[id];
public FoodModel GetFoodById(FoodId foodId) { return(_foodRepository.GetFoodById(foodId)); }
public void SetFood(FoodId food) { this.food = FoodData.Find(food); foodField.SetFood(this.food); }