Ejemplo n.º 1
0
 public ActionResult Edit(Meal meal)
 {
     if (ModelState.IsValid)
     {
         MealRepository.Edit(meal);
         return RedirectToAction("Index");
     }
     return View(meal);
 }
Ejemplo n.º 2
0
        public ActionResult Create(Meal meal)
        {
            if (ModelState.IsValid)
            {
                meal.Id = Guid.NewGuid();
                MealRepository.Create(meal);
                return RedirectToAction("Index");
            }

            return View(meal);
        }
Ejemplo n.º 3
0
        public void Edit(Meal meal)
        {
            var tableClient = GetClient();

            CloudTable table = tableClient.GetTableReference(TABLE_NAME);

            var toInsert = AutoMapper.Mapper.Map<Meal, MealTableEntity>(meal);
            TableOperation insertOrReplaceOperation = TableOperation.InsertOrReplace(toInsert);

            table.Execute(insertOrReplaceOperation);
        }