internal string Delete(int id, string userId) { var original = GetById(id); if (original.CreatorId != userId) { throw new Exception("Invalid Delete Permissions"); } _repo.Delete(id); return("delorted"); }
internal String Delete(int id) { var original = GetById(id); if (original == null) { throw new Exception("Bad Request"); } _repo.Delete(id); return("Successfully Deleted"); }
internal String Delete(int id, string userId) { var original = GetById(id); if (original == null) { throw new Exception("Bad Request"); } if (original.CreatorId != userId) { throw new Exception("Invalid Permissions"); } _repo.Delete(id); return("Successfully Deleted"); }