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