Exemplo n.º 1
0
 public bool AddNewUser(UserDataContract user)
 {
     //这里可以定义数据持久化操作,访问数据库==
     Console.WriteLine("Hello! ,This an DataContract demo for WCF Service ");
     Console.WriteLine("UserName: {0} ", user.Name);
     Console.WriteLine("UserEmail: {0}", user.Email);
     Console.WriteLine("Mobile: {0}", user.Mobile);
     return(true);
 }
Exemplo n.º 2
0
        public UserDataContract GetUserByName(string name)
        {
            UserDataContract user = new UserDataContract();

            user.Address = "ShangHai China";
            user.Email   = "*****@*****.**";
            user.Name    = "Frank Xu Lei";
            Console.WriteLine("Hello! {0},This an overloading demo WCF Service ", name);
            return(user);
        }