private async Task SaveTags(List <String> newTags, Post post) { await RemoveOldTags(newTags, post); await AddNewTags(newTags, post); }
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); }