protected override Task OnReceivedAsync(IRequest request, string connectionId, string data)
        {
            var viewModel = JsonConvert.DeserializeObject<WorkspaceState>(data);
            var now = DateTimeOffset.UtcNow;
            var command = new EvaluateCodeCommand
                          {
                              Documents = new List<Document>(viewModel.Project.Documents),
                              References = new List<Reference>(viewModel.Project.References),

                              ClientId = connectionId,
                              Submitted = now,
                              Expires = now + TimeSpan.FromSeconds(5)
                          };

            Bus.Instance.Publish(command);

            return TaskAsyncHelper.Empty;
        }
Beispiel #2
0
        protected override Task OnReceivedAsync(IRequest request, string connectionId, string data)
        {
            var viewModel = JsonConvert.DeserializeObject <PostViewModel>(data);

            var model = viewModel.ToPost();

            var command = new EvaluateCodeCommand
            {
                Documents = new List <Document>(model.Documents),

                ClientId      = connectionId,
                Submitted     = DateTime.UtcNow,
                TimeoutPeriod = ExecutionTimeout
            };

            Bus.Instance.Publish(command);

            return(EmptyTask);
        }