示例#1
0
        public async Task <dynamic> Post(RetrospectiveItemModel value)
        {
            var command = new CreateOrUpdateRetrospectiveItemCommand
            {
                Description         = value.Description,
                CategoryId          = value.CategoryId,
                RetrospectiveId     = value.RetrospectiveId,
                RetrospectiveItemId = value.Id,
                Votes = value.Votes
            };
            EntityCommandResult <RetrospectiveItem> result = await commandDispatcher.CreateRetrospectiveItemAsync(command);

            return(new { id = result.Entity.Id });
        }
        protected EntityCommandResult CreateEntityCommandResult(bool success, string message = "", object data = null)
        {
            var entityCommandResult = new EntityCommandResult(success, message, data);

            if (entityCommandResult.HasAProblem && notificationContext.HasNotification)
            {
                var log = new StringBuilder();
                notificationContext.Notifications.ToList().ForEach(error =>
                {
                    entityCommandResult.AddValidationError(error.Message);
                    log.Append(error.Message);
                });
                logger.LogError(log.ToString());
            }
            return(entityCommandResult);
        }