title: Unable to create a constant value of type '?'. Only primitive types or enumeration types are supported in this context
body: <p>On the following code I am getting an exception</p>
  
  <pre><code>var ret = db.Especialidades.Except(sol.EspecialidadesExigidas).ToList();
  </code></pre>
  
  <p>This is the Exception</p>
  
  <pre><code>Unable to create a constant value of type 'TCC.Models.Especialidade'. 
  Only primitive types or enumeration types are supported in this context.
  </code></pre>
  
  <p>I have looked into other similar questions and tried to adapt their answers, but to no success. 
  Other atempts made:</p>
  
  <pre><code>var ret = (from e in db.Especialidades where !sol.EspecialidadesExigidas.Any(e2 =&gt; e2.Id == e.Id) select e).ToList(); 
  var ret = (from e in db.Especialidades where !sol.EspecialidadesExigidas.Select(e2 =&gt; e2.Id).Contains(e.Id) select e).ToList();
  </code></pre>
  
  <p>What I am trying to do is to get all "Especialidades" from the database that`s not included in the list</p>