public async Task Delete(string id) { var plan = await _planService.GetByIdAsync(id); ValidateUser(plan.UserId); await _planService.DeleteAsync(id); }
public async Task <ActionResult> DeleteAsync(string offerName, string planName) { AADAuthHelper.VerifyUserAccess(this.HttpContext, _logger, true); _logger.LogInformation($"Delete plan {planName} from offer {offerName}."); await _planService.DeleteAsync(offerName, planName); return(NoContent()); }
public async Task <IActionResult> Delete(string id) { if (!ModelState.IsValid) { return(BadRequest(GetErrorFromModelState())); } bool result = await _planService.DeleteAsync(id); return(Ok(result)); }
public async Task <IActionResult> DeleteAsync(int id) { var result = await _planService.DeleteAsync(id); if (!result.Success) { return(BadRequest(result.Message)); } var planResource = _mapper.Map <Plan, PlanResource>(result.Resource); return(Ok(planResource)); }
public Task <IActionResult> DeleteAsync(long id) { return(_planService.DeleteAsync(id).ResultAsync()); }
public async Task <IActionResult> Delete(Guid id) { return(Respond(await _service.DeleteAsync <Guid>(Context.TenantId, id))); }
public async Task <IActionResult> Remove(int id) { await _planService.DeleteAsync(id); return(RedirectToAction("List")); }