示例#1
0
文件: UnitTest1.cs 项目: qcjxberin/ec
        public void Register()
        {
            IUserService service = client.CreateInstance<IUserService>();
            User user = new User { EMail = "*****@*****.**", Name = "henry" };
            User result = service.Register(user);
            Assert.AreEqual(user.Name, result.Name);
            Assert.AreNotEqual(user.CreateTime, result.CreateTime);

        }
示例#2
0
文件: Program.cs 项目: qcjxberin/ec
        static void Main(string[] args)
        {
            System.Threading.Timer mTimer;

            try
            {
                DateTime dt;
                ProtoClient client = new ProtoClient("127.0.0.1");
                client.Receive = (o, e) =>
                {
                    Console.WriteLine("Receive From Server:{0}", e.Message);
                };
                User user = new User { EMail = "*****@*****.**", Name = "henry" };
                client.Send(user);
                IUserService us = client.CreateInstance<IUserService>();
                user = us.Register(user);
                Console.WriteLine(user.CreateTime);


                user = us.Register("henry", null);
                Console.WriteLine(user.CreateTime);

                user = us.Register("henry", "*****@*****.**", out dt);
                Console.WriteLine(dt);

                user = us.ReturnNull();
                Console.WriteLine(user == null);


                us.GetTime(out dt);

                Console.WriteLine(dt);
                //mTimer = new System.Threading.Timer(d =>
                //{
                //    DateTime s;
                //    us.GetTime(out s);
                //    Console.WriteLine(s);
                //}, null, 1000, 1000);

            }
            catch (Exception e_)
            {
                Console.WriteLine(e_);
            }
            Console.Read();


        }
示例#3
0
文件: Program.cs 项目: qcjxberin/ec
 public User Register(string name, string email, out DateTime createTime)
 {
     createTime = DateTime.Now;
     User user = new User() { Name = name, EMail = email };
     return user;
 }
示例#4
0
文件: Program.cs 项目: qcjxberin/ec
 public User Register(string name, string email)
 {
     User user = new User() { Name = name, EMail = email, CreateTime = DateTime.Now };
     return user;
 }
示例#5
0
文件: Program.cs 项目: qcjxberin/ec
 public User Register(User user)
 {
     user.CreateTime = DateTime.Now;
     return user;
 }
示例#6
0
文件: Program.cs 项目: qcjxberin/ec
        public User Regisetr(ISession session, User user)
        {
            user.CreateTime = DateTime.Now;
            "Register invoke[Name:{0} Email:{1}]".Log4Debug(user.Name, user.EMail);

            return user;
        }