コード例 #1
0
        private async Task SaveTags(List <String> newTags, Post post)
        {
            await RemoveOldTags(newTags, post);

            await AddNewTags(newTags, post);
        }
コード例 #2
0
        private async Task <string> RenameUrlIfItAlreadyExistAsync(Guid blogId, string url, Post existingPost = null)
        {
            var postList = await _postRepository.GetListAsync();

            if (postList.Where(p => p.Url == url).WhereIf(existingPost != null, p => existingPost.Id != p.Id).Any())
            {
                return(url + "-" + Guid.NewGuid().ToString().Substring(0, 5));
            }

            return(url);
        }