Example #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());
        }
Example #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());
        }
Example #3
0
 private List <TagResource> GetAllTags()
 {
     return(_tagService.All().ToResource());
 }
Example #4
0
 public List <TagResource> GetAll()
 {
     return(_tagService.All().ToResource());
 }