如何在LINQ中获得'anotherColumnName'?
SELECT thisColumnName as anotherColumnName FROM TableName
我有以下显然给我'thisColumnName'而不是'anotherColumnName'
var query = from names in _context.TableName select names; return query.ToList();
Ian P.. 8
使用匿名类型:
var query = (from name in _context.Table select new { anotherColumnName = name.ColumnName });
祝好运!
使用匿名类型:
var query = (from name in _context.Table select new { anotherColumnName = name.ColumnName });
祝好运!