Renaming columns with LINQ
I have been using LINQ to SQL on a WinForms project. I have played around with LINQ in the past but have never had the opportunity to use it on a project.
I have used SQL Server for probably about 10 years now and consider my T-SQL skills to be pretty decent.
So something such as renaming a column in a T-SQL statement which is very easy.
select CustomerID, CompanyName as Company from Customers
I found at least initially to be somewhat difficult in LINQ, but after some reading I managed to figure out how to do it, it seems a little strange but it does work.
var customers = from c in nwDb.Customers
select new { c.CustomerID, Company = c.CompanyName };
Hope this helps other developers.