Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot implicitly convert type 'List<AnonymousType#1>' to 'IEnumerable<Models.APPLICANT>'
    primarykey
    data
    text
    <p>Trying To Left Join 2 Tables</p> <pre><code> public IEnumerable&lt;APPLICANT&gt; GetApplicant() { IEnumerable&lt;APPLICANT&gt; applicantdata = Cache.Get("applicants") as IEnumerable&lt;APPLICANT&gt;; if (applicantdata == null) { var applicantList = (from a in context.Profiles join app in context.APPLICANTs on a.PROFILE_ID equals app.Profile_id into joined from j in joined.DefaultIfEmpty() select new { Profiles = a, APPLICANTs= j, }).Take(1000); applicantdata = applicantList.AsQueryable().OrderBy(v =&gt; v.APPLICANT_ID).ToList(); if (applicantdata.Any()) { Cache.Set("applicants", applicantdata, 30); } } return applicantdata; } </code></pre> <p>But the problem is that im having error at the last Line </p> <pre><code>applicantdata = applicantList.AsQueryable().OrderBy(v =&gt; v.APPLICANT_ID).ToList(); </code></pre> <p>The error says </p> <blockquote> <p>Error 1 Cannot implicitly convert type '<code>System.Collections.Generic.List&lt;AnonymousType#1&gt;</code>' to '<code>System.Collections.Generic.IEnumerable&lt;Models.APPLICANT&gt;</code>'. An explicit conversion exists (are you missing a cast)</p> </blockquote> <p>THIS IS MY APPLICANT CLASS</p> <pre><code>[DataContract(IsReference = true)] public partial class APPLICANT { [DataMember] public int APPLICANT_ID { get; set; } [DataMember] public string APPLICANT_LastName { get; set; } [DataMember] public string APPLICANT_FirstName { get; set; } [DataMember] public string APPLICANT_MiddleName { get; set; } [DataMember] public string APPLICANT_Address { get; set; } [DataMember] public string APPLICANT_City { get; set; } [DataMember] public string APPLICANT_Phone { get; set; } [DataMember] public string APPLICANT_Email { get; set; } [DataMember] public Nullable&lt;int&gt; Profile_id { get; set; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload