コード例 #1
0
        public async Task <IActionResult> UpdateStory([FromRoute] Guid organizationId, [FromRoute] Guid storyId,
                                                      [FromBody] UpdateStoryInput model)
        {
            var story = await _storyService.UpdateStory(_accountManager, storyId, model);

            return(Ok(story));
        }
コード例 #2
0
        private async Task <StoryResult> UpdateStoryInternal(Guid storyId, UpdateStoryInput input)
        {
            var retVal = new StoryResult {
                StoryId = storyId
            };

            var entity = await Repository
                         .FirstOrDefaultAsync(x => x.Id == storyId);

            entity.InjectFrom(input);

            entity.Updated     = DateTimeOffset.UtcNow;
            entity.ObjectState = ObjectState.Modified;

            var records = await Repository.UpdateAsync(entity, true);

            _logger.LogDebug(GetLogMessage("{0} Records updated"), records);


            if (records > 0)
            {
                retVal.Succeeded = true;
                await Task.Run(() =>
                {
                    RaiseEvent(new StoryUpdatedEvent
                    {
                        StoryId = storyId
                    });
                });
            }

            return(retVal);
        }
コード例 #3
0
 public Task <StoryResult> UpdateStory(IOrganizationContractor co,
                                       Guid storyId,
                                       UpdateStoryInput model)
 {
     return(UpdateStoryInternal(storyId, model));
 }
コード例 #4
0
 public Task <StoryResult> UpdateStory(IOrganizationProjectManager pm,
                                       Guid storyId,
                                       UpdateStoryInput model)
 {
     return(UpdateStoryInternal(storyId, model));
 }
コード例 #5
0
 public Task <StoryResult> UpdateStory(IProviderAgencyOwner agencyOwner,
                                       Guid storyId,
                                       UpdateStoryInput model)
 {
     return(UpdateStoryInternal(storyId, model));
 }