// 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.
And I get this error: