示例#1
0
        public async Task Delete(string id)
        {
            var plan = await _planService.GetByIdAsync(id);

            ValidateUser(plan.UserId);

            await _planService.DeleteAsync(id);
        }
示例#2
0
        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());
        }
示例#3
0
        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));
        }
示例#5
0
 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)));
 }
示例#7
0
        public async Task <IActionResult> Remove(int id)
        {
            await _planService.DeleteAsync(id);

            return(RedirectToAction("List"));
        }