Esempio n. 1
0
        public async Task<ActionResult> Create(CreateReplyModel model)
        {
            var result = await _commandService.SendAsync(
                new CreateReplyCommand(
                    model.PostId,
                    model.ParentId,
                    model.Body,
                    _contextService.CurrentAccount.AccountId));

            if (result.Status != AsyncTaskStatus.Success)
            {
                return Json(new { success = false, errorMsg = result.ErrorMessage });
            }

            return Json(new { success = true });
        }
Esempio n. 2
0
        public async Task<ActionResult> Create(CreateReplyModel model)
        {
            var result = await _commandService.ExecuteAsync(
                new CreateReplyCommand(
                    ObjectId.GenerateNewStringId(),
                    model.PostId,
                    model.ParentId,
                    model.Body,
                    _contextService.CurrentAccount.AccountId), CommandReturnType.EventHandled);

            if (result.Status != AsyncTaskStatus.Success)
            {
                return Json(new { success = false, errorMsg = result.ErrorMessage });
            }

            return Json(new { success = true });
        }