public static BlogArticle CreateSingle() { var entity = new BlogArticle { ModificationDate = DateTime.UtcNow.AddMonths(-1), AuthorId = UserCreator.CreateSingle().Id, }; entity.Title = string.Format(CultureInfo.InvariantCulture, "Title {0}", entity.Id); entity.Content = string.Format(CultureInfo.InvariantCulture, "Content {0}", entity.Id); return entity; }
public BlogArticleDetailsModel MapToDetail(BlogArticle blogArticle, User author) { return new BlogArticleDetailsModel { Id = blogArticle.Id, Title = blogArticle.Title, Content = blogArticle.Content.Replace(Environment.NewLine, "<br />"), CreationDate = blogArticle.CreationDate, PublishDate = blogArticle.PublishDate, ModificationDate = blogArticle.ModificationDate, AuthorName = author.Login.LoginName, }; }
public BlogArticle AddBlogArticle(BlogArticle blogArticle) { if (blogArticle == null) throw new ArgumentNullException("blogArticle"); return _catalogsContainer.BandCatalog.Add(blogArticle); }
public void RemoveBlogArticle(BlogArticle blogArticle) { if (blogArticle == null) throw new ArgumentNullException("blogArticle"); _catalogsContainer.BandCatalog.Remove(blogArticle); }
public BlogArticle UpdateBlogArticle(BlogArticle article) { if (article == null) throw new ArgumentNullException("article"); return BandRepository.UpdateBlogArticle(article); }
public void RemoveBlogArticle(BlogArticle article) { if (article == null) throw new ArgumentNullException("article"); BandRepository.RemoveBlogArticle(article); }
public UpdateBlogArticleModel MapToUpdate(BlogArticle entity) { return new UpdateBlogArticleModel { Id = entity.Id, Title = entity.Title, Content = entity.Content, }; }