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"); //通过工厂这种方法不方便 }
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()); } }
public CategoryController() { categoryService = new CategoryService(); }
public CategoryController(InterfaceCategoryService categoryService) { _categoryService = categoryService; }
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; }
public FactoryActivatedMiddleware(InterfaceCategoryService db) { _db = db; }