Example #1
0
        public ActionResult Delete(int id)
        {
            var model = _repository.GetCommandById(id);

            if (model == null)
            {
                return(NotFound());
            }

            _repository.Delete(model);
            _repository.SaveChanges();
            return(NoContent());
        }
        public bool Delete(int id, out CategoryReadModel deletedCategory)
        {
            var foundCategory = _repository.LookupCategory(id);

            if (foundCategory == null)
            {
                deletedCategory = null;
                return(false);
            }

            _repository.Delete(foundCategory);
            _repository.SaveChanges();

            deletedCategory = _mapper.Map <CategoryReadModel>(foundCategory);
            return(true);
        }
Example #3
0
 public void Delete(CommandModel command)
 {
     _repository.Delete(command);
 }