Hi, can anyone tell me why this doesnt work?
public class GeocodeCoord
{
public string Outcode { get; set; }
public int X { get; set; }
public int Y { get; set; }
}
List<GeocodeCoord> _geocode;
using (MyDataContext db = new MyDataContext())
{
_geocode = db.Geocodes.Select(g => new GeocodeCoord { g.postcode, g.x, g.y }).ToList<GeocodeCoord>();
}
I get the following error:
Cannot initialize type 'Search.GeocodeCoord' with a collection initializer because it does not implement 'System.Collections.IEnumerable'
Thanks