Пример #1
0
        private void InitializeModule()
        {
            if (_moduleService.FindList().Count() > 0)
            {
                return;
            }

            var modules = new List <Module>();
            var module  = new Module()
            {
                Controller   = "Article",
                Description  = "实现文章功能",
                Enabled      = true,
                Name         = "文章模块",
                ModuleOrders = new List <ModuleOrder> {
                    new ModuleOrder {
                        Name = "ID升序", Order = 0
                    },
                    new ModuleOrder {
                        Name = "ID降序", Order = 1
                    },
                    new ModuleOrder {
                        Name = "发布时间升序", Order = 2
                    },
                    new ModuleOrder {
                        Name = "发布时间降序", Order = 3
                    },
                    new ModuleOrder {
                        Name = "点击升序", Order = 4
                    },
                    new ModuleOrder {
                        Name = "点击降序", Order = 5
                    }
                }
            };

            modules.Add(module);
            _moduleService.AddRange(modules.ToArray());
        }
Пример #2
0
 public static void InitializeModule(InterfaceModuleService moduleService)
 {
     if (moduleService.FindList().Count() == 0)
     {
         var modules = new List <Module>();
         var module  = new Module()
         {
             Controller   = "Article",
             Description  = "实现文章功能",
             Enabled      = true,
             Name         = "文章模块",
             ModuleOrders = new List <ModuleOrder> {
                 new ModuleOrder {
                     Name = "ID升序", Order = 0
                 },
                 new ModuleOrder {
                     Name = "ID降序", Order = 1
                 },
                 new ModuleOrder {
                     Name = "发布时间升序", Order = 2
                 },
                 new ModuleOrder {
                     Name = "发布时间降序", Order = 3
                 },
                 new ModuleOrder {
                     Name = "点击升序", Order = 4
                 },
                 new ModuleOrder {
                     Name = "点击降序", Order = 5
                 }
             }
         };
         modules.Add(module);
         moduleService.AddRange(modules.ToArray());
     }
 }