public ActionResult Stations_Read([DataSourceRequest]DataSourceRequest request) { IQueryable<Station> stations = db.Stations; DataSourceResult result = stations.ToDataSourceResult(request, station => new { Id = station.Id, Code = station.Code, Name = station.Name, SubZone = new SubZone() { Name = station.SubZone.Name // got error here. } }); return Json(result); }
public class Station : Entity { public string Code { get; set; } public string Name { get; set; } public Guid SubZoneId { get; set; } public virtual SubZone SubZone { get; set; } }
SubZone = new SubZone() { Name = station.SubZone.Name // got error here. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)