Ejemplo n.º 1
0
        public static UpdateConcept CreateWithTags(int id = 444)
        {
            var result = new UpdateConcept
            {
                AuthorId = 15,
                Description = "test-edit-concept-description-view-model",
                Id = id,
                Tags = new List<string> { "tag;mark;concept" },
                Title = "test-edit-concept-title-view-model"
            };

            return result;
        }
Ejemplo n.º 2
0
        public static UpdateConcept CreateValidWithoutTags(long id = 4343)
        {
            var result = new UpdateConcept
                             {
                                 AuthorId = 15,
                                 Description = "test-edit-concept-description-view-model",
                                 Id = id,
                                 Tags = null,
                                 Title = "test-edit-concept-title-view-model"
                             };

            return result;
        }
Ejemplo n.º 3
0
        public void UpdateConcept(UpdateConcept updateConcept)
        {
            var concept = this.conceptRepository.GetConceptWithTags(updateConcept.Id);

            concept.Description = updateConcept.Description;
            concept.Title = updateConcept.Title;

            concept.LastUpdate = DateTime.Now;
            concept.EditCount++;

            var newTagList = this.tagRepository.GetTags(updateConcept.Tags);

            concept.Tags.Clear();
            concept.Tags.AddRange(newTagList);

            this.conceptRepository.Save();
        }