I'm not sure how best to do this. Just LINQ queries are easy enough for me, but I'm looking for the most efficient way here.
I have 2 tables, sliders and sliders. SliderItems have an FK that points to the id of the sliders.
I get information about a particular slider:
public static List<Slider> GetSlider(Slider sItem) { DBContext db = new DBContext(); if (sItem.Id != Guid.Empty) { var list = from tbl in db.Sliders where tbl.Id == sItem.Id orderby tbl.Id select tbl; return list.ToList(); } }
So what I need to do for my homepage is to drop the data set that I want to write to the data list. Thus, combining Slider + SliderItems that go with it.
Am I just doing a normal LINQ query with a JOIN statement and throwing them into a shared list that returns to my DataList?
Appreciate any thoughts and direction.
source share