0
我使用的選擇兩場如何將'System.Collections.Generic.List <AnonymousType#1>至IEnumerable的
public ViewModelList(CRMEntities crm)
{
var cus = (from c in crm.Customer
select new
{ c.Name, c.Family });
AllCustomer = new ObservableCollection<Custom>(cus.ToList());
}
public ObservableCollection<Custom> AllCustomer
{
get;
set;
}
}
public class Custom
{
public string Name{get;set;}
public string Family { get; set; }
}
這個代碼,但提供了以下錯誤
不能轉換'System.Collections.Generic.List'到'System.Collections.Generic.List'
非常感謝:) –