Beispiel #1
0
        public void TestArticle2()
        {
            var context             = UnitTest1.GetDbContext();
            var userId              = "ce2b60e1-1ad0-4f89-bb32-90e99e812467";
            CategoryViewProvider cp = new CategoryViewProvider(context);

            cp.Show(cp.Get2(userId));
        }
Beispiel #2
0
        public IActionResult Get(
            [FromServices] CategoryViewProvider provider,
            [FromServices] UserManager <ApplicationUser> userManager
            )
        {
            var id   = userManager.GetUserId(User);
            var item = provider.Get(id);

            return(Json(new
            {
                SubCategories = item.Item1,
                Articles = item.Item2
            }));
        }