Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            var apiResult = TryExecute(() =>
            {
                _technologyRepository.Delete(id);
                _unitOfWork.Commit();
                return(true);
            }, "Technology deleted sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Method to Delete a specific Technology From the DataBase.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <bool> Delete(string id)
        {
            // var getAllData = await _technologyRepository.GetAll();
            bool returnValue = await _technologyRepository.Delete(id);;

            if (returnValue)
            {
                return(returnValue);
            }
            else
            {
                throw new OneDATException(OneDATExceptionCode.NotFound);
            }
        }