コード例 #1
0
 public PushResponseBuilder(ISession session, PushRequest pushRequest, IAccessControlLists acls)
 {
     this.session = session;
     this.pushRequest = pushRequest;
     this.acls = acls;
     this.metaPopulation = this.session.Database.MetaPopulation;
 }
コード例 #2
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;
     }
 });
コード例 #3
0
ファイル: DatabaseController.cs プロジェクト: lulzzz/allors2
 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));
     }
 }
コード例 #4
0
ファイル: PushResponseBuilder.cs プロジェクト: lulzzz/allors2
 public PushResponseBuilder(ISession session, User user, PushRequest pushRequest)
 {
     this.session     = session;
     this.user        = user;
     this.pushRequest = pushRequest;
 }