public static UserTotal Get(User user) { CarPoolToolEntities entities = new CarPoolToolEntities(); var usertotals = from b in entities.Totals where b.username == user.username select b; Total total = usertotals.FirstOrDefault(); return(new UserTotal(user, total)); }
public static List <User> GetAll() { CarPoolToolEntities entities = new CarPoolToolEntities(); return(entities.Users.ToList()); }
public static User GetByUsername(string username) { CarPoolToolEntities entities = new CarPoolToolEntities(); return((from u in entities.Users where u.username.Equals(username) select u).FirstOrDefault()); }