// 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); }
// 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); }