public IHttpActionResult DeleteParent(string id) { if (parentsService.ExistsID(id) == false) { return(NotFound()); } return(Ok(parentsService.DeleteParent(id))); }
public IHttpActionResult DeleteParent(int id) { Parent parent = parentsService.DeleteParent(id); if (parent == null) { return(NotFound()); } return(Ok(parent)); }
public IHttpActionResult DeleteParent(string id) { Parent parent = parentsService.DeleteParent(id); if (parent == null) { return(NotFound()); } logger.Info("Deleting parent"); return(Ok(parent)); }
public async Task <IHttpActionResult> DeleteParent(int parentId) { var userData = IdentityHelper.GetLoggedInUser(RequestContext); logger.Info("Delete Parent {@parentId} by {@userData}", parentId, userData); var result = await service.DeleteParent(parentId); if (result == null) { return(NotFound()); } return(Ok(result)); }
public IHttpActionResult DeleteParent(Guid id) { ParentDto parent; try { parent = db.DeleteParent(id); } catch (NullReferenceException e) { logger.Error(e.Message); return(NotFound()); } logger.Info("Deleted a parent" + parent.Name + " " + parent.Surname); return(Ok(parent)); }