Пример #1
0
 public ActionResult <PushResponse> Post([FromBody] PushRequest request) =>
 this.PolicyService.PushPolicy.Execute(
     () =>
 {
     try
     {
         using (var session = this.DatabaseService.Database.CreateSession())
         {
             var acls            = new WorkspaceAccessControlLists(session.GetUser());
             var responseBuilder = new PushResponseBuilder(session, request, acls);
             var response        = responseBuilder.Build();
             return(response);
         }
     }
     catch (Exception e)
     {
         this.Logger.LogError(e, "PushRequest {request}", request);
         throw;
     }
 });
Пример #2
0
 public IActionResult Push([FromBody] PushRequest pushRequest)
 {
     try
     {
         return(this.PolicyService.PushPolicy.Execute(
                    () =>
         {
             using (var session = this.DatabaseService.Database.CreateSession())
             {
                 var responseBuilder = new PushResponseBuilder(session, session.GetUser(), pushRequest);
                 var response = responseBuilder.Build();
                 return this.Ok(response);
             }
         }));
     }
     catch (Exception e)
     {
         this.Logger.LogError(e, "Exception");
         return(this.StatusCode(500, e.Message));
     }
 }