public static AspNetUser GetAspNetUser(string userId) { using (btfbEntities db = new btfbEntities()) { return(db.AspNetUsers.First(u => u.Id == userId)); } }
public List <Model> GetModelsFromMake(int makeId) { try { using (btfbEntities db = new btfbEntities()) { return(db.Models.Where(x => x.MakeId == makeId).ToList()); } } catch { return(null); } }
public Make GetMake(int makeId) { try { using (btfbEntities db = new btfbEntities()) { return(db.Makes.Include("Models").OrderBy(x => x.Make1).FirstOrDefault(x => x.Id == makeId)); } } catch { return(null); } }
public List <Make> GetMakes() { try { using (btfbEntities db = new btfbEntities()) { return(db.Makes.Include("Models").OrderBy(x => x.Make1).ToList()); } } catch { return(null); } }
public List <State> GetStates() { try { using (btfbEntities db = new btfbEntities()) { return(db.States.OrderBy(x => x.Abbr).ToList()); } } catch { return(null); } }
public UsersDTO GetUser(string userId) { using (btfbEntities db = new btfbEntities()) { AspNetUser user = db.AspNetUsers.FirstOrDefault(u => u.Id == userId); UsersDTO userDto = new UsersDTO(); if (user != null) { userDto.firstName = user.FirstName; userDto.lastName = user.LastName; userDto.phone = user.PhoneNumber; userDto.email = user.Email; } return(userDto); } }