コード例 #1
0
        public async Task <AuthorDto> CreateAsync(CreateAuthorDto input)
        {
            var author = await _authorManager.CreateAsync(
                input.Name,
                input.BirthDate,
                input.ShortBio
                );

            await _authorRepository.InsertAsync(author);

            return(ObjectMapper.Map <Author, AuthorDto>(author));
        }
コード例 #2
0
        public async Task <AuthorDto> CreateAsync(CreateAuthorDto input)
        {
            var author = await _authorManager.CreateAsync(
                input.Name,
                input.BirthDate,
                input.ShortBio
                );

            await _authorRepository.InsertAsync(author);

            await _cacheService.RemoveAsync(AuthorCacheConsts.CachePrefix.Author);

            await _distributedEventBus.PublishAsync(new BookEventData
            {
                Key = AuthorCacheConsts.CachePrefix.Author
            });

            return(ObjectMapper.Map <Author, AuthorDto>(author));
        }