So I have an Event class which is generated from Enitity Framework, I have extended what it generated in a partial like so:
public partial class Event
{
[DataMemberAttribute()]
public EventDate CurrentEventDate { get; set; }
}
When I use the custom property ON THE SERVER it's fine, example:
[WebGet]
public IQueryable<Event> EventsOn(string date)
{
var to Return = // Get my events here
toReturn.ToList().ForEach(ev => ev.CurrentEventDate = ev.EventDates.Where(
evd => evd.StartDateTime.Date <= qDate.Date && evd.EndDateTime >= qDate.Date).Single());
return toReturn.AsQueryable();
}
But when I try and look at this object in Javascript, it tells me that:
Error: 'CurrentEventDate' is null or not an object
How can I have custom properties show up after they've been sent down the wire?