예제 #1
0
        //

        public Person FindById(Int32 id)
        {
            //ĬÈÏtop 1--1Ìõ¼Ç¼
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ");
            strSql.Append("id,username,password,age,registerDate,address  ");
            strSql.Append("from [Person] ");
            strSql.Append("where  id=@id  ");
            //
            var result = DbHelperSql.Find(strSql.ToString(), new Person {
                Id = id
            });

            return(result);
        }
예제 #2
0
        //

        public User FindById(Int32 userId)
        {
            //ĬÈÏtop 1--1Ìõ¼Ç¼
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ");
            strSql.Append("userId,username,passwordHash,email,phoneNumber,isFirstTimeLogin,accessFailedCount,creationDate,isActive,lastTimestamp  ");
            strSql.Append("from [User] ");
            strSql.Append("where  UserId=@userId  ");
            //
            var result = DbHelperSql.Find(strSql.ToString(), new User {
                UserId = userId
            });

            return(result);
        }