I updated my .net core 2.2 to 5

I have a error about ef that

> 
> System.InvalidOperationException: 'The LINQ expression 'x' 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.'
> 
> 
> 

```
public List<CustomerPageModel> GetCustomers(int AccountID)
        {
            return (from p in context.Customers
                    join f in context.Patients on p.ID equals f.CustomerID into ps
                    from t in ps.DefaultIfEmpty()
                    where p.AccountID == AccountID
                    select new CustomerPageModel
                    {
                        ID = p.ID,
                        Name = p.Name,
                        IsActive = p.IsActive,
                        TC = p.TC,
                        Surname = p.Surname,
                        Email = p.Email,
                        Address = p.Address,
                        Phone = p.Phone,
                        Note = p.Note,
                        AccountID = p.AccountID,
                        Pats = string.Join(",", ps.Select(x => x.Name)),
                        PatCount = ps.Count()
                    })
            .GroupBy(p => p.ID)
            .Select(g => g.First())
           .ToList();
        }

```

How can I convert that code?