Q:

Unable to create a constant value of type 'Anonymous type'. Only primitive types or enumeration types are supported in this context. in Linq C#

i want to join 2-3 lists having the data from the database and 2 lists having data as object type how to get the actual results from it?
here is my code and object lists
var calls = context.queued_calls;

//to get classifications into list
var classificationsToList = (from c in context.classifications
                             select new { c.classification_id, c.classification1 }).ToList();

//to get tha users from the user table 
var users = (from u in context.users
             select new { u.user_id, u.first_name, u.last_name }).ToList();

//to get agents from agents table
var agents = (from a in context.agents
              select new { a.agent_id, a.user_id }).ToList();

This are the four list objects and here is my query that i am executing onto it
var agentsClass = (from cs in calls
                  join ag in agents on cs.agent_id equals ag.agent_id
                  join u in users on ag.user_id equals u.user_id
                  join cls in classificationsToList on cs.classification_id equals cls.classification_id
                  group cs by new { cs.classification_id, cls.classification1, cs.agent_id, u.user_id } into clas                         
                  select new { agent_id = clas.Key.agent_id, user_id = clas.Key.user_id, classification = clas.Key.classification1, classifications_count = clas.Count() }).OrderBy(a => a.agent_id).ToList();

A:

I got the solution just i need to do convert the calls to List and the error solved 

