日期:2014-05-20 浏览次数:20912 次
    protected List<ProductT> GetProduct()
    {
        using (defaultModel.defaultEntities edata = new defaultModel.defaultEntities())
        {
            List<int> ids = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            var pp = (from p in edata.Product
                      join t in edata.Type on p.type_id equals t.type_id
                      join ps in edata.Product_Sort on p.product_id equals ps.product_id
                      where ids.Any(c => c == ps.sort_id) 
                      select new { t.type_name, p.product_id, p.product_order, p.product_name })
                      .Distinct().OrderBy(p => p.product_order).Skip(0).Take(10);
            return //这里怎么才能返回自定义的集合?   
        }
    }
    public ProductT product { get { return Page.GetDataItem() as ProductT; } }
    public class ProductT {
        public int product_id { get; set; }
        public int product_name { get; set; }
        public string type_name { get; set; }
        public string product_order { get; set; }
    }