Esempio n. 1
0
        public HttpResponseMessage Delete(int id)
        {
            SucessResponse response = new Sabio.Web.Models.Responses.SucessResponse();

            _meetingsService.Delete(id);
            return(Request.CreateResponse(response));
        }
        public async Task <ActionResult <Meeting> > Delete(int id)
        {
            try
            {
                var existing = await meetingService.GetAsync(id);

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

                meetingService.Delete(existing);

                if (await meetingService.SaveChangesAsync())
                {
                    return(Ok());
                }
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }

            return(BadRequest("Failed to delete the meeting"));
        }
Esempio n. 3
0
        public async Task <IActionResult> Delete(Guid id)
        {
            try
            {
                var response = await _service.Delete(id);

                if (!response.IsSuccessful)
                {
                    return(BadRequest(response));
                }
                return(Ok(response));
            }
            catch
            {
                return(StatusCode(500, "Internal Server Error."));
            }
        }
Esempio n. 4
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _meetingService.Delete(id);

            return(RedirectToAction(nameof(Index)));
        }
Esempio n. 5
0
 // DELETE: api/Meeting/5
 public void Delete(int id)
 {
     _meetingService.Delete(id);
 }
        public IActionResult DeleteById(int id)
        {
            var status = _meetingService.Delete(id);

            return(Ok(status));
        }