Example #1
0
        public async Task rating_service_delete_should_succeed()
        {
            var gameId = 1;
            var userId = 1;

            _ratingService.Delete(userId, gameId);
            _mediatorBusMock.Verify(x => x.SendCommand(It.IsAny <DeleteRatingCommand>()), Times.Once);
        }
 public ActionResult DeleteRecipe(RecipeViewModel recipe)
 {
     if (recipe.IsDeleted == true)
     {
         ingredientService.DeleteAllIngredientsForRecipe(recipe.RecipeID);
         instructionsService.DeleteAllInstructionsForRecipe(recipe.RecipeID);
         categoryService.DeleteCategoriesForRecipe(recipe.RecipeID);
         subcategoryService.DeleteSubcategoriesForRecipe(recipe.RecipeID);
         commentService.DeleteCommentsForRecipe(recipe.RecipeID);
         recipeService.DeleteRecipeByID(recipe.RecipeID);
         ratingService.Delete(recipe.RatingID);
     }
     return(RedirectToAction("Index", "Recipe"));
 }
Example #3
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                rating rating = ES.GetById(id);
                ES.Delete(rating);
                ES.Commit();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #4
0
 public Result Delete(int id)
 {
     return(_service.Delete(id));
 }