The comment from Mark G solved the issue. Original Link Thanks. Just pasting in here in case the link ever disappears.
Add the following to your dbcontext configuration
sqloptions.EnablePrimitiveCollectionsSupport(true);
sqloptions.TranslateParameterizedCollectionsToConstants();
e.g.
services.AddDbContextPool<DatabaseUnitOfWork>(options => options
.UseMySql(connectionstring, new MySqlServerVersion(new Version(8, 0, 21)),
sqloptions =>
{
sqloptions.EnablePrimitiveCollectionsSupport(true);
sqloptions.TranslateParameterizedCollectionsToConstants();
});