示例#1
0
        public IActionResult deleteAppointment([FromBody] deleteObjectViewModel model)
        {
            if (model.id == ObjectId.Empty)
            {
                return(BadRequest(ErrorMessageConstants.OBJECT_ID_INVALID));
            }

            bool returnedItem = db.deleteAppointment(model.id);

            if (returnedItem)
            {
                return(Ok());
            }

            return(NotFound());
        }
        public IActionResult deleteCustomer([FromBody] deleteObjectViewModel model)
        {
            if (model.id == ObjectId.Empty)
            {
                return(BadRequest(ErrorMessageConstants.OBJECT_ID_INVALID));
            }

            var result = db.deleteCustomer(model.id);

            switch (result)
            {
            case 1: return(Ok());

            case 2: return(NotFound());

            case 3: return(StatusCode(409));

            default: return(NotFound());
            }
        }