Пример #1
0
        public void TestIf_All_ReturnsCorrectNumberOfTags()
        {
            this.context.Tags.AddRange(new List <Tag>
            {
                new Tag(),
                new Tag(),
                new Tag()
            });

            this.context.SaveChanges();

            Assert.NotEmpty(context.Tags);
            Assert.Equal(3, tagService.All().Count());
        }
Пример #2
0
        public IActionResult Create()
        {
            this.ViewData["Categories"] = categoryService.GetCategories()
                                          .Select(p => new SelectListItem
            {
                Value = p.Id.ToString(),
                Text  = p.Name
            });

            this.ViewData["Tags"] = tagService.All()
                                    .Select(p => new SelectListItem
            {
                Value = p.Id.ToString(),
                Text  = p.Name
            });
            return(View());
        }
Пример #3
0
 private List <TagResource> GetAllTags()
 {
     return(_tagService.All().ToResource());
 }
Пример #4
0
 public List <TagResource> GetAll()
 {
     return(_tagService.All().ToResource());
 }