I've tried the below query to get a list from a database using linq but get the following error
Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.
I'm not sure why the error is being caused.
List<a> a = await (from p in new db_Context().Items
where p.sub_Var.Name.Equals((sender as Button).Text)
orderby p.Name
select p).ToListAsync();