Esempio n. 1
0
        public void UpdateArticle(int id)
        {
            var authorList = SelectedAuthor.Select(a => new Author {
                Id = a.Id
            }).ToList();
            var categoriesList = SelectedCategory.Select(c => new Category {
                Id = c.Id, Name = c.Name
            }).ToList();

            Article newArticle = new Article()
            {
                Id          = id,
                Title       = Title,
                Preamble    = Preamble,
                ArticleBody = ArticleBody,
                Categories  = categoriesList.ToArray(),
                Authors     = authorList.ToArray(),
                UpdatedDate = DateTime.Now
            };

            client.UpdateArticle(newArticle);
        }