Ejemplo n.º 1
0
        internal string Delete(int id)
        {
            var data = GetById(id);

            _repo.Delete(id);
            return("Deleted");
        }
Ejemplo n.º 2
0
        internal Recipe Delete(int id)
        {
            Recipe recipeToRemove = GetOne(id);

            _repo.Delete(recipeToRemove);
            return(recipeToRemove);
        }
Ejemplo n.º 3
0
        internal void Delete(int id, string creatorId)
        {
            Recipe recipe = GetById(id);

            if (recipe.CreatorId != creatorId)
            {
                throw new Exception("You cannot delort another users recipe!");
            }
            if (!_repo.Delete(id))
            {
                throw new Exception("Something has gone terribly wrong!");
            }
        }
Ejemplo n.º 4
0
        internal void Delete(int id, string creatorId)
        {
            Recipe recipe = GetById(id);

            if (recipe.CreatorId != creatorId)
            {
                throw new Exception("You can't delete another user's recipe");
            }
            if (!_repo.Delete(id))
            {
                throw new Exception("Something is Wrong");
            }
            ;
        }
Ejemplo n.º 5
0
 public void Delete(Guid id)
 {
     _repo.Delete(id);
 }