The situation: ajax call that calls an MVC action which returns List<CustomObject>
.
During debugging, the MVC side shows that I have, for example, 20+ records with about 15 columns with data in an entity framework object format. That is to say that I can see the data in record.id and record.name like I should.
The data list is passed back to the ajax.success callback function but appears to only be a string describing object of type System.Collections.Generic.List'1[CustomObject]'
. That is to say, it is just a string: System.Collections.Generic.List'1[CustomObject]'
How the devil do I get that data either
readable by javascript
into a javascript/jquery readable opbject.
Edit: code sample:
public async Task<List<visitorInformation>> GetChartData(string startDate, string endDate) {
//coalesce date into a single array
DateTime[] dateRange = new DateTime[2];
DateTime.TryParseExact(startDate, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out dateRange[0]);
DateTime.TryParseExact(endDate, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out dateRange[1]);
DateTime dtStartDate = dateRange[0];
DateTime dtEndDate = dateRange[1];
return await db.visitorInformation.Where(w => w.dateOfVisit >= dtStartDate && w.dateOfVisit <= dtEndDate).ToListAsync();
}