I am using Simple.Data and want to know if I can Select a single column and then cast it to a list of string values. For example using the query below I get the error:
Cannot implicitly convert type 'Simple.Data.SimpleRecord' to 'string'
var result = _database.ParentRegionList.All()
.Select(_database.ParentRegionList.RegionName)
.Where(_database.ParentRegionList.RegionName.Like(startsWith + "%"))
.Distinct()
.ToList<string>();
However if I create a class LocationAutoComplete that has a single public property "RegionName" of type string then the cast works fine.
var result = _database.ParentRegionList.All()
.Select(_database.ParentRegionList.RegionName)
.Where(_database.ParentRegionList.RegionName.Like(startsWith + "%"))
.Distinct()
.ToList<LocationAutoComplete>();