static public Teen GetTeen(int id) { Teen ret = null; using (var db = Code.TeenDataHelper.GetEE()) { var g = db.Teens.Where(x => x.id == id).FirstOrDefault(); if (g != null) { ret = new Teen(g); ret.PopulateNightData(g.TeenNights.ToList()); } } return(ret); }
static public List <Teen> GetAllTeens() { List <Teen> ret = new List <Teen>(); using (var db = Code.TeenDataHelper.GetEE()) { var g = db.Teens.ToList(); g.ForEach(x => { var t = new Teen(x); t.PopulateNightData(x.TeenNights.ToList()); ret.Add(t); }); } return(ret); }
public static Teen GetTeen(int id) { Teen ret = null; using(var db = Code.TeenDataHelper.GetEE()) { var g = db.Teens.Where(x => x.id == id).FirstOrDefault(); if(g != null) { ret = new Teen(g); ret.PopulateNightData(g.TeenNights.ToList()); } } return ret; }
public static List<Teen> GetAllTeens() { List<Teen> ret = new List<Teen>(); using(var db = Code.TeenDataHelper.GetEE()) { var g = db.Teens.ToList(); g.ForEach(x => { var t = new Teen(x); t.PopulateNightData(x.TeenNights.ToList()); ret.Add(t); }); } return ret; }