public async Task InvokeAsnyc(HttpContext conext, InterfaceCategoryService db)
        {
            var keyValue = conext.Request.Query["key"];

            if (!string.IsNullOrWhiteSpace(keyValue))
            {
                //相关逻辑
            }
            await _next(conext);
        }
 public BootStrapController(InterfaceCategoryService categoryService, IMapper mapper, IOptions <MyOptions> optionAccessor
                            , IOptions <MyOptionsWithDelegateConfig> optionsAccessorWithDelegate, ILogger <BootStrapController> logger) // ILoggerFactory logger
 {
     _categoryService             = categoryService;
     _mapper                      = mapper;
     _optionAccessor              = optionAccessor;
     _optionsAccessorWithDelegate = optionsAccessorWithDelegate;
     //Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
     _logger = logger;
     //_logger = logger.CreateLogger("NineskyStudy.Controllers.BootStrapController"); //通过工厂这种方法不方便
 }
示例#3
0
        public static void InitializeCategory(InterfaceCategoryService categoryService)
        {
            if (categoryService.FindList().Count() == 0)
            {
                var modules = new List <Category>();
                modules.Add(new Category
                {
                    Name        = "公司简介",
                    View        = "Index",
                    Type        = CategoryType.General,
                    ParentId    = 0,
                    ParentPath  = "",
                    Order       = 0,
                    Target      = LinkTarget._self,
                    Description = "这是公司简介",
                    General     = new CategoryGeneral {
                        ContentView = "Index", ModuleId = 1, ContentOrder = 1
                    }
                });

                modules.Add(new Category
                {
                    Name        = "单页栏目",
                    View        = "Index",
                    Type        = CategoryType.Page,
                    ParentId    = 0,
                    ParentPath  = "",
                    Order       = 1,
                    Target      = LinkTarget._self,
                    Description = "这是一个单页栏目",
                    Page        = new CategoryPage  {
                        Content = "<p class=\"text-danger\">这是单页栏目内容</p>"
                    }
                });

                modules.Add(new Category
                {
                    Name        = "博客",
                    View        = "Index",
                    Type        = CategoryType.Link,
                    ParentId    = 0,
                    ParentPath  = "",
                    Order       = 2,
                    Target      = LinkTarget._self,
                    Description = "跳转到博客",
                    Link        = new  CategoryLink {
                        Url = "http://ninesky.cn"
                    }
                });

                categoryService.AddRange(modules.ToArray());
            }
        }
示例#4
0
 public CategoryController()
 {
     categoryService = new CategoryService();
 }
示例#5
0
 public CategoryController(InterfaceCategoryService categoryService)
 {
     _categoryService = categoryService;
 }
示例#6
0
 public CategoryController()
 {
     categoryRepository = new CategoryService();
 }
 public CategoryNavViewComponent(InterfaceCategoryService categoryService)
 {
     _categoryService = categoryService;
 }
 public HomeController(InterfaceModuleService moduleService, InterfaceCategoryService categoryService, IOptions <AppOptions> options)
 {
     _moduleService   = moduleService;
     _categoryService = categoryService;
     _options         = options;
 }
示例#9
0
 public CategoryController()
 {
     categoryRepository = new CategoryService();
 }
 public FactoryActivatedMiddleware(InterfaceCategoryService db)
 {
     _db = db;
 }