Esempio n. 1
0
        public void Add(ArticleVM.Article article)
        {
            var dto = new DtoArticle
            {
                AuthorId = (int)article.AuthorId,
                Title    = article.Title,
                Body     = article.Body
            };

            svc.Add(dto);
        }
Esempio n. 2
0
        public void Update(ArticleVM.Article article)
        {
            var dto = new DtoArticle
            {
                ArticleId = article.ArticleId,
                AuthorId  = article.AuthorId,
                Title     = article.Title,
                Body      = article.Body
            };

            svc.Update(dto);
        }
Esempio n. 3
0
        public ArticleVM.Article Update(int id)
        {
            var dto = Find(id);

            var article = new ArticleVM.Article
            {
                ArticleId = dto.ArticleId,
                AuthorId  = dto.AuthorId,
                Title     = dto.Title,
                Body      = dto.Body
            };

            return(article);
        }