breeze 내에 날짜 계산을 지원하는 표준 쿼리 구문이 없으므로 매개 변수와 함께 명명 된 쿼리를 사용하는 것이 가장 좋습니다. 서버 사실상
[HttpGet]
public IQueryable<Schedule> SchedulesAfter(DateTime givenDate) {
// This needs to return a valid IQueryable
// You will need to find the correct EF syntax to support your query here. You may need to use an EF function here instead.
return ContextProvider.Context.Schedules
.Where(s => DbFunctions.AddMinutes(s.DueDate ,s.LateMinutes) > givenDate);
}
에 클라이언트
var q = EntityQuery.from("SchedulesAfter")
.where(...) // this can be any valid where clause for the 'Schedule' type (or can be omitted completely if you don't need additional query restrictions.
.withParameter({ givenDate: aGivenDate });
에이
좋은 답변입니다. 감사합니다. – user3571051
@Jay Traband 제 생각에'Where (s => s.DueDate + s.LateMinutes> givenDate)'는'Where (s => DbFunctions.AddMinutes (s.DueDate, s.LateMinutes)> givenDate로 대체되어야합니다) 'LastMinutes가'int'라고 가정합니다. –
감사합니다. :) 업데이트되었습니다. –