I have a table with various fields and I would like to know how to retrieve only one of those fields using linq and put them to list?
var st = context.myTable.FirstOrDefault.ToList
I have a table with various fields and I would like to know how to retrieve only one of those fields using linq and put them to list?
var st = context.myTable.FirstOrDefault.ToList
Try this
var st = context.myTable.Select(x => x.SomeProperty).ToList();