public User GetInformationUser(string username) { ChatDBDataContext dataContext = new ChatDBDataContext(); var existusers = (from u in dataContext.users where u.username == username select u).Single(); User newuser = new User(); newuser.userid = existusers.userid; newuser.username = existusers.username; newuser.password = existusers.password; newuser.avarta = existusers.avarta; return newuser; }
private User GetUserById(int userid) { User NewUser = new User(); var Users = from U in DB.users where U.userid == userid select U; foreach (user user in Users) { NewUser.userid = user.userid; NewUser.username = user.username; NewUser.password = user.password; NewUser.avarta = user.avarta; } return NewUser; }
private User GetUserByUsername(string Username) { User NewUser = new User(); var users = (from U in DB.users where U.username == Username select U).Distinct().Single(); NewUser.userid = users.userid; NewUser.username = users.username; NewUser.password = users.password; NewUser.avarta = users.avarta; return NewUser; }
private User GetUserByUsername(string Username) { User NewUser = new User(); var Users = (from U in DB.users where U.username == Username select U).Distinct(); foreach (user user in Users) { NewUser.userid = user.userid; NewUser.username = user.username; NewUser.password = user.password; NewUser.avarta = user.avarta; } return NewUser; }