Ejemplo n.º 1
0
        private BabyService CreateBabyService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new BabyService(userId);

            return(service);
        }
Ejemplo n.º 2
0
        // GET: Baby
        public ActionResult Index()
        {
            var userID  = Guid.Parse(User.Identity.GetUserId());
            var service = new BabyService(userID);
            var model   = service.GetBaby();

            return(View(model));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main(string[] args)
        {
            int work, comp;
            System.Threading.ThreadPool.GetMinThreads(out work, out comp);
            Console.WriteLine(string.Format("原最小线程{0},IO:{1}", work, comp));
            System.Threading.ThreadPool.GetMaxThreads(out work, out comp);
            Console.WriteLine(string.Format("原最大线程{0},IO:{1}", work, comp));

            BabyService baby = new BabyService();

            if (args.Length > 0)
            {
                baby.Start(args);
                System.Threading.Thread.Sleep(Timeout.Infinite);
            }
            else
            {
                ServiceBase[] ServicesToRun = new ServiceBase[] { baby };
                ServiceBase.Run(ServicesToRun);
            }
        }