我有一个名为 Company 的表,我正在尝试使用 linq Query 访问该表的数据并转换为公司 Calss
List<Company> companyData = (from c in dataContext.Companies
select new
{
CompanyName =c.CompanyName,
Address1 =c.Address1,
Addredd2 =c.Address2,
city=c.City.CityName,
state =c.State.StateName,
country =c.Country.CountryName,
Telephone1 =c.Telephone1,
Telephone2 =c.Telephone2,
Mobile1 =c.Mobile1,
Mobile2=c.Mobile2,
Email1 =c.Email1,
Email2 = c.Mobile2,
Fax1=c.Fax1,
Fax2=c.Fax2,
TinNo=c.TinNo,
IsGroupCompany=c.IsGroupCompany
}).ToList<Company>();
但它给出了像 ToList() 这样的错误有一些无效的参数如何给列名获取列表格式的数据
提前谢谢