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,
                       };
        }
Exemple #3
0
        public BlogArticle AddBlogArticle(BlogArticle blogArticle)
        {
            if (blogArticle == null) throw new ArgumentNullException("blogArticle");

            return _catalogsContainer.BandCatalog.Add(blogArticle);
        }
Exemple #4
0
        public void RemoveBlogArticle(BlogArticle blogArticle)
        {
            if (blogArticle == null) throw new ArgumentNullException("blogArticle");

            _catalogsContainer.BandCatalog.Remove(blogArticle);
        }
Exemple #5
0
        public BlogArticle UpdateBlogArticle(BlogArticle article)
        {
            if (article == null) throw new ArgumentNullException("article");

            return BandRepository.UpdateBlogArticle(article);
        }
Exemple #6
0
        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,
                };
 }