Created
January 31, 2019 13:19
-
-
Save evgomes/9b71d67997d4d8596b8a930c654f3368 to your computer and use it in GitHub Desktop.
DeleteAsync from CategoriesController, of Supermarket API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpDelete("{id}")] | |
public async Task<IActionResult> DeleteAsync(int id) | |
{ | |
var result = await _categoryService.DeleteAsync(id); | |
if (!result.Success) | |
return BadRequest(result.Message); | |
var categoryResource = _mapper.Map<Category, CategoryResource>(result.Category); | |
return Ok(categoryResource); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment