Example #1
0
        public ActionResult Delete(BeerView beer)
        {
            try
            {
                if (beer.Growler && beer.TastingRoom)
                {
                    var result1 = mongoService.DeleteBeerGrowler(beer);
                    var result2 = mongoService.DeleteBeerTastingRoom(beer);
                }
                else if (beer.Growler)
                {
                    var result = mongoService.DeleteBeerGrowler(beer);
                }
                else if (beer.TastingRoom)
                {
                    var result = mongoService.DeleteBeerTastingRoom(beer);
                }

                Brewery brewery = mongoService.GetBrewery(beer.id);

                return(RedirectToAction("Index", "Brewery"));
            }
            catch
            {
                return(View());
            }
        }