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
        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());
        }
 public IActionResult Delete(Guid id)
 {
     return(new WebApiDelete(this, () => _manager.DeleteAsync(id),
                             operationType: OperationType.Delete, statusCode: HttpStatusCode.NoContent));
 }