d4software / QueryTree

Data reporting and visualization for your app
http://querytreeapp.com
GNU Lesser General Public License v3.0
341 stars 122 forks source link

QueryTree dotnet version update in Dockerfile breaks invitation #149

Closed fxdave closed 1 year ago

fxdave commented 1 year ago
// InvitationsController.cs
var invites = db.OrganisationInvites.Where(uc => uc.InviteEmail.ToLower() == CurrentUser.Email.ToLower() && uc.AcceptedOn == null && uc.RejectedOn == null);

if (invites.Any() == false)
{
    // No invites to look at, redirect to home
    return RedirectToAction("Index", "Home");
}

List<InvitationViewModel> viewModels = new List<InvitationViewModel>();

foreach(var orgGrp in invites
    .Include(c => c.CreatedBy)
    .GroupBy(c => c.OrganisationId))
{

And I get this error:

System.InvalidOperationException: The exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true.
---> System.InvalidOperationException: The LINQ expression 'DbSet<OrganisationInvite>()
.Where(uc => uc.InviteEmail.ToLower() == __ToLower_0 && uc.AcceptedOn == null && uc.RejectedOn == null)
.Include(c => c.CreatedBy)
.GroupBy(c => c.OrganisationId)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
d4nt commented 1 year ago

@fxdave I've pushed a fix in https://github.com/d4software/QueryTree/commit/407f7315f65f94d2262bba44fa1f4f369447d13d