Beispiel #1
0
 public DependencyResult CheckNodeReferences()
 {
     try
     {
         if (DependencyResult == null)
         {
             ServiceContext = new ServiceContextOfUser();
         }
         DependencyResult = ServiceContext.Init();
     }
     catch (Exception ex)
     {
         LoggerProvider.GetLog4netLogger("ServiceLog").Error(ex.ToString());
     }
     return(DependencyResult);
 }
 protected override ILogger GetDefaultServiceLogger()
 {
     return(LoggerProvider.GetLog4netLogger("ServiceLog"));
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            //基础配置
            var service = new ContextOfLIJService(new ConfigOfLIJData(), new ProtocolConfig(), LoggerProvider.GetLog4netLogger("ServiceLog"));
            var result  = service.Init();

            if (!result.IsAllDependenciesAvailable)
            {
                Console.WriteLine(result.Message);
                Console.ReadLine();
                return;
            }
            //业务逻辑
            try
            {
                using (DbSession session = service.GetDbSession(HelperOfDb.DbNameOfLostInJungle))
                {
                    //用户集合
                    var users = new UserServiceReference.UserServiceClient().GetAllUsers();
                    //LIJ领域模型
                    var dataContext = new ContextOfLIJData();
                    dataContext.InitData(session);
                    //数据生成器
                    var creator = new CreatorOfLIJData();
                    creator.InitData(session, dataContext, users.Data);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Beispiel #4
0
 public int Test()
 {
     LoggerProvider.GetLog4netLogger("ServiceLog").Error("message for test");
     return(1);
 }