public async Task <IActionResult> RunAsync( [HttpTrigger(AuthorizationLevel.Function, "delete", Route = "OptOut/{userUuid}")] HttpRequest req, string userUuid) { Logger.LogInformation($"{nameof(OptOutApi)} processed a request."); var user = new UserParameter() { UserUuid = userUuid }; // validation var validationResult = await Validation.ValidateAsync(req, user); if (!validationResult.IsValid) { AddBadRequest(req); return(validationResult.ErrorActionResult); } // delete tek await DiagnosisRepository.Delete(user); // delete user await UserRepository.Delete(user); return(new NoContentResult()); }
public IActionResult DeleteDiagnosis(long id) { Diagnosis dia = dia_repo.Find(id); if (dia == null) { return(NotFound()); } dia_repo.Delete(dia); return(Ok()); }