public bool Delete(long id)
        {
            bool deleted = Repo.Delete(id);

            Unit.SaveChanges();
            return(deleted);
        }
示例#2
0
        public IActionResult DeletePath([FromRoute] int id)
        {
            try
            {
                Path path = _pathRepository.GetById(id);

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

                _pathRepository.Delete(path);
                return(Accepted());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }