コード例 #1
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var result = await _contactManager.DeleteAsync(id);

            if (result.IsSuccess)
            {
                return(Ok(new { Message = result.Message }));
            }
            return(BadRequest(new { Message = result.Message }));
        }
コード例 #2
0
ファイル: ContactController.cs プロジェクト: keepr/keepr-api
        public async Task <ActionResult <ResponseModel <string> > > DeleteAsync(int id)
        {
            var result = await _contactManager.DeleteAsync(id, CurrentUser.Id);

            if (result)
            {
                return(Ok(new ResponseModel <string>("Contact deleted.")));
            }
            else
            {
                return(BadRequest(new ErrorModel("Unable to delete Contact.")));
            }
        }
コード例 #3
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            await _contactManager.DeleteAsync(id);

            return(NoContent());
        }
コード例 #4
0
 public IActionResult Delete(Guid id)
 {
     return(new WebApiDelete(this, () => _manager.DeleteAsync(id),
                             operationType: OperationType.Delete, statusCode: HttpStatusCode.NoContent));
 }