Esempio n. 1
0
 protected void Application_Start()
 {
     log4net.Config.XmlConfigurator.Configure();
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     //开启线程扫描错误队列,将错误信息写入日志文件中
     ScanExceptionQueue();
     //开启线程扫描Lucene队列
     DataIndexManager.GetInstance().ThreadScanBookQueue();
 }
Esempio n. 2
0
        public ActionResult InsertBook()
        {
            Books book = new Books();

            book.Title              = "一本闲书";
            book.Author             = "姜敞";
            book.PublisherId        = 1;
            book.PublishDate        = DateTime.Now;
            book.ISBN               = "fsaf";
            book.WordsCount         = 100;
            book.UnitPrice          = 100;
            book.ContentDescription = "Java面向对象,.net面向对象,一本闲书,微软姜敞,深受专家和程序员喜爱";
            IBooksService bookService = new BooksService();

            bookService.AddEntity(book);
            DataIndexManager.GetInstance().InserData2Queue(10000, book.Title, book.ContentDescription, EnumBookSave.Addbook);
            return(Content("OK"));
        }