Ejemplo n.º 1
0
 public override Task <ApproveResponse> Approve(ApproveRequest request, ServerCallContext context)
 {
     return(Task.FromResult(new ApproveResponse
     {
         Proposal = repo.Approve(request.Id)
     }));
 }
 public IActionResult Approve(int proposalId)
 {
     try
     {
         return(new ObjectResult(proposalRepo.Approve(proposalId)));
     }
     catch (InvalidOperationException)
     {
         return(NotFound());
     }
 }