public ActionResult <InvokeResponse> Post(InvokeRequest request) =>
 this.PolicyService.InvokePolicy.Execute(
     () =>
 {
     try
     {
         using (var session = this.DatabaseService.Database.CreateSession())
         {
             var acls            = new WorkspaceAccessControlLists(session.GetUser());
             var responseBuilder = new InvokeResponseBuilder(session, request, acls);
             var response        = responseBuilder.Build();
             return(response);
         }
     }
     catch (Exception e)
     {
         this.Logger.LogError(e, "InvokeRequest {request}", request);
         throw;
     }
 });
Esempio n. 2
0
 public IActionResult Invoke([FromBody] InvokeRequest invokeRequest)
 {
     try
     {
         return(this.PolicyService.InvokePolicy.Execute(
                    () =>
         {
             using (var session = this.DatabaseService.Database.CreateSession())
             {
                 var responseBuilder = new InvokeResponseBuilder(session, session.GetUser(), invokeRequest);
                 var response = responseBuilder.Build();
                 return this.Ok(response);
             }
         }));
     }
     catch (Exception e)
     {
         this.Logger.LogError(e, "Exception");
         return(this.StatusCode(500, e.Message));
     }
 }