Hello,
I am evaluating Scheduler for MVC for project. I am able to load the events from the EntityFramework table with this (shortened) code in the overridden OnFinish() method:
Events = ctx.RMSRequest.Where(r => r.AssignedDate != null && r.NegotiatedDeadline != null && (r.NegotiatedDeadline > start || r.AssignedDate < end)).ToList();
If I change it to load only some of the fields into a defined object with the following code:
Events = ctx.RMSRequest.Where(r => r.AssignedDate != null && r.NegotiatedDeadline != null && (r.NegotiatedDeadline > start || r.AssignedDate < end)).Select(r => new DayPilotEvent()
{
SysId = r.SysId,
AssignedDate = (DateTime)r.AssignedDate,
NegotiatedDeadline = (DateTime)r.NegotiatedDeadline,
ShortDescription = r.ShortDescription,
AssignedToSysId = r.AssignedToSysId
})
.ToList();
then I get the message that the object DayPilotEvent does not contain a property "AssignedDate".
The object is defined with:
public class DayPilotEvent
{
public string SysId;
public DateTime AssignedDate;
public DateTime NegotiatedDeadline;
public string ShortDescription;
public string AssignedToSysId;
}
Can anyone see what I am doing wrong here? Any hint will be apreciated.