public PersonalData getPersonalDataById(long id) { using (var context = new RoomRentEntities()) { PersonalData personal = context.PersonalData .Where(c => c.id == id) .FirstOrDefault(); return(personal); } }
public PersonalData getPersonalDataByPhone(long phoneNumber) { PersonalData personal = new PersonalData(); using (var context = new RoomRentEntities()) { personal = context.PersonalData .Where(c => c.phone_number == phoneNumber) .FirstOrDefault(); } return(personal); }
public string getPerson(long userId) { Users temp = new Users(); PersonalData temp2 = new PersonalData(); using (var context = new RoomRentEntities()) { temp = context.Users .Where(c => c.id == userId).FirstOrDefault(); temp2 = context.PersonalData .Where(d => d.id == temp.personal_id).FirstOrDefault(); } string str = temp2.name + " " + temp2.surname; return(str); }