public Response <Car> DeleteCarById(int CarID)
        {
            Response <Car> res = new Response <Car>();

            try
            {
                using (var carBusiness = new CarBusiness())
                {
                    res = carBusiness.DeleteCarById(CarID);
                }
            }
            catch (Exception ex)
            {
                res.isSuccess = false;
                res.Message   = "An error occured in CarService.DeleteCarById\n" + ex.Message;
            }
            return(res);
        }
Example #2
0
        // DELETE: api/Car/id
        // url parameter = id of the car to be deleted
        // deletes the car with given id
        // SOAP Name = DeleteCarById
        public IHttpActionResult Delete(int id)
        {
            var content = new Response <Car>();

            try
            {
                using (var carBusines = new CarBusiness())
                {
                    content = carBusines.DeleteCarById(id);
                }
            }
            catch (Exception ex)
            {
                content.isSuccess = false;
                content.Message  += ex.Message;
            }
            return(new StandartResult <Car>(content, Request));
        }