public IQueryable <Swimmer> GetSwimmers() { var db = new SplashFun.Models.SwimContext(); IQueryable <Swimmer> query = db.Swimmers; return(query); }
// The id parameter should match the DataKeyNames value set on the control // or be decorated with a value provider attribute, e.g. [QueryString]int id public IQueryable <Swimmer> SwimmerDetailsView_GetItem([QueryString("swimmerID")] int?swimmerId) { var db = new SplashFun.Models.SwimContext(); IQueryable <Swimmer> query = db.Swimmers; if (swimmerId.HasValue) { query = query.Where(s => s.SwimmerID == swimmerId); } else { query = null; } return(query); }
public System.Collections.IEnumerable repTimeRecords_GetData([QueryString("swimmerID")] int?swimmerId) { var db = new SplashFun.Models.SwimContext(); times = db.TimeRecords.Where(t => t.Swimmer.SwimmerID == swimmerId).ToList();; if (!IsPostBack) { Repeater repeaterTimes = SwimmerDetailsView.FindControl("repBestTimes") as Repeater; if (repeaterTimes != null) { repeaterTimes.DataSource = times; repeaterTimes.DataBind(); } } return(times); }