Skip to content

Commit

Permalink
Added root level date range
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Jan 6, 2023
1 parent 7be66c3 commit 90e3141
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NeuroSpeech.EntityAccessControl/BaseEntityController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ public async Task<IActionResult> PostMethod(
case "thenByDescending":
lm.Method = "ThenByDescending";
break;
case "dateRange":
lm.Method = "DateRange";
lm.Expression = "@0, @1, @2";
break;
case "joinDateRange":
lm.Method = "JoinDateRange";
lm.Expression = "@0, @1, @2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ public static IQueryable<DateRangeEntity<T>> JoinDateRange<T>(this IQueryable<T>
return join;
}

public static IQueryable<DateRange> DateRange<T>(this IQueryable<T> @this, DateTime start, DateTime end, string step)
where T : class
{
if (@this.Provider is not EntityAccessQueryProvider q1)
{
throw new NotSupportedException();
}
var db = q1.db;
return db.DateRangeView(start, end, step);
}

public static IIncludableQueryable<T, TProperty>
IncludeSecure<T, TProperty>(this IQueryable<T> queryable, string path)
where T : class
Expand Down

0 comments on commit 90e3141

Please sign in to comment.