public async Task <ActionResult> DeleteDog([FromRoute] string userId, long dogId) { var dogToDelete = await dogService.FindDogById(dogId); if (dogToDelete != null && dogToDelete.UserId == userId) { await dogService.DeleteDogAsync(dogToDelete); return(Ok()); } return(BadRequest()); }
public async Task <IActionResult> DeleteDog([FromRoute] int dogId) { await dogsService.DeleteDogAsync(dogId); return(Ok()); //var result = await dogsService.DeleteDog(dogId); //if (result.Reason != null) //{ // return BadRequest(result); //} //return Ok(); }