Ejemplo n.º 1
0
        public ActionResult Push(PushRequest pushRequest)
        {
            var user     = this.AllorsUser ?? Singleton.Instance(this.AllorsSession).Guest;
            var response = new PushResponseBuilder(this.AllorsSession, user, pushRequest, Group);

            return(this.JsonSuccess(response.Build()));
        }
Ejemplo n.º 2
0
        public Task <PushResponse> Push(PushRequest request)
        {
            try
            {
                using (var session = this.Database.CreateSession())
                {
                    var acls            = new WorkspaceAccessControlLists(session.GetUser());
                    var responseBuilder = new PushResponseBuilder(session, request, acls);
                    var response        = responseBuilder.Build();
                    if (!response.HasErrors)
                    {
                        session.Commit();
                    }

                    return(Task.FromResult(response));
                }
            }
            catch (Exception e)
            {
                this.Logger.LogError(e, "PushRequest {request}", request);
                throw;
            }
        }