Asp.net mvc 4 RavenHQ索引查询返回(500)内部服务器错误
我最初的问题可以在这里找到: 我现在通过使用以下索引获得了非常好的效果:Asp.net mvc 4 RavenHQ索引查询返回(500)内部服务器错误,asp.net-mvc-4,ravendb,Asp.net Mvc 4,Ravendb,我最初的问题可以在这里找到: 我现在通过使用以下索引获得了非常好的效果: public class JobsQueuedListCurrent : AbstractIndexCreationTask<AppointmentReminder, JobsQueuedListCurrent.IndexResult> { public class IndexResult { public int Id { get; set; } public
public class JobsQueuedListCurrent : AbstractIndexCreationTask<AppointmentReminder, JobsQueuedListCurrent.IndexResult>
{
public class IndexResult
{
public int Id { get; set; }
public DateTime AppointmentDateTime { get; set; }
public ReminderStatus ReminderStatus { get; set; }
public DateTime JobDateTime { get; set; }
public JobStatus JobStatus { get; set; }
}
public JobsQueuedListCurrent()
{
Map = appointmentreminders => from appointmentreminder in appointmentreminders
from job in appointmentreminder.NotificationJobs
where (appointmentreminder.ReminderStatus != ReminderStatus.Confirmed)
select new
{
Id = appointmentreminder.Id,
AppointmentDateTime = appointmentreminder.AppointmentDateTime,
ReminderStatus = appointmentreminder.ReminderStatus,
JobDateTime = appointmentreminder.AppointmentDateTime.AddDays(job.DaysOffset),
JobStatus = job.JobStatus
};
Store(x => x.AppointmentDateTime, FieldStorage.Yes);
Store(x => x.ReminderStatus, FieldStorage.Yes);
Store(x => x.JobDateTime, FieldStorage.Yes);
Store(x => x.JobStatus, FieldStorage.Yes);
}
}
公共类JobSqueedListCurrent:AbstractIndexCreationTask
如何允许查询在Where子句中使用datetime?顺便说一句,我正在使用最新的客户端不稳定(1.2.2139-unstable)与RavenHQ对话。谢谢。您正在使用1.2客户端与1.0服务器对话
public ActionResult GetJobsQueuedListCurrent()
{
var jobsqueuedlist = RavenSession.Query<JobsQueuedListCurrent.IndexResult, JobsQueuedListCurrent>()
.OrderBy(x => x.AppointmentDateTime)
.As<AppointmentReminder>()
.Take(20)
.ToList();
return View("List", jobsqueuedlist);
}
.Where(x => (x.JobDateTime <= DateTime.Now))
public ActionResult GetJobsQueuedListCurrent()
{
var jobsqueuedlist = RavenSession.Query<JobsQueuedListCurrent.IndexResult, JobsQueuedListCurrent>()
.Where(x => (x.JobDateTime <= DateTime.Now))
.OrderBy(x => x.AppointmentDateTime)
.As<AppointmentReminder>()
.Take(20)
.ToList();
return View("List", jobsqueuedlist);
}