if (NavigationContext.QueryString.TryGetValue("selectedItem", out selectedArea))
{
using (dbContext c = new dbContext(dbContext.ConnectionString))
{
c.CreateIfNotExists();
c.LogDebug = true;
MainLongListSelector.ItemsSource = c.details.ToList();
}
}我想要过滤dbcontext中的内容,我应该如何做?谁来帮帮我
发布于 2014-07-10 12:24:17
试着这样做
MainLongListSelector.ItemsSource = c.details.Where(elem=> elem.Property==5).ToList();// returns elements with Property=5我假设您的details有一个名为Property的属性,但是您可以使用您的字段,例如.Where(elem=> elem.Name=='Peeter' && elem.Age > 30) //takes elements with Age > 30 and Name=Peter
https://stackoverflow.com/questions/24676430
复制相似问题