Wie kommen Sie wie ich in einem Lambda .join hinzufügen Ich erhalte Problem mit meinem Linq Lambda .Where(..
Linq to SQL hinzugefügt eine Lambda .join Geting AnonymousType # 1' enthält keine Definition und keine Erweiterungsmethode
.Where(z => z.Inact_ind == "N" && z.Wwid != null)
Das ist in Ordnung BIS ich hinzufügen .Join
darüber.
zB
.Join(Rpm_scrty_emp_info, z => z.Wwid, ei => ei.Wwid, (z, ei) => new{z,ei})
linq query
(LINQPad, so Rpm_scrty_rpm_usrs ist im Wesentlichen die gleiche wie DbContext dbset)
var queryAllUsers = Rpm_scrty_rpm_usrs
.Join(Rpm_scrty_emp_info, z => z.Wwid, ei => ei.Wwid, (z, ei) => new{z,ei})
.Where(z => z.Inact_ind == "N" && z.Wwid != null)
.AsEnumerable()
.Select(z => new rpm_scrty_rpm_usr()
{
usr_id = z.Usr_id,
usr_lnm = z.Usr_lnm,
usr_pwd = z.Usr_pwd,
usr_fnm = z.Usr_fnm,
wwid = z.Wwid,
apprvr_wwid = z.Apprvr_wwid,
chg_dtm = z.Chg_dtm,
chg_usr_id = z.Chg_usr_id,
dflt_ste_id = z.Dflt_ste_id,
cre_dtm = z.Cre_dtm,
cre_usr_id = z.Cre_usr_id,
lst_pwd_chg_dtm = z.Lst_pwd_chg_dtm,
lst_accs_dtm = z.Lst_accs_dtm,
email_id = z.Email_id,
inact_ind = z.Inact_ind,
salt = z.Salt,
tel = z.Tel
//});
})
.ToList();
Poco Klasse
public class rpm_scrty_rpm_usr
{
public string usr_id { get; set; }
public string usr_fnm { get; set; }
public string usr_lnm { get; set; }
public string usr_pwd { get; set; }
public string email_id { get; set; }
public string wwid { get; set; }
public string tel { get; set; }
public int dflt_ste_id { get; set; }
public DateTime? lst_pwd_chg_dtm { get; set; }
public DateTime? lst_accs_dtm { get; set; }
public string apprvr_wwid { get; set; }
public string inact_ind { get; set; }
public string cre_usr_id { get; set; }
public DateTime? cre_dtm { get; set; }
public string chg_usr_id { get; set; }
public DateTime? chg_dtm { get; set; }
public string salt { get; set; }
}
ok, es bekam, Vielen Dank das funktioniert! –
FYI, diese Person fragte im Grunde die gleiche Frage, Sie verdienen die Antwort IMO, ich würde nur eine Antwort für den Kerl hier http://stackoverflow.com/questions/37470564/change-syntax-to-linq-to-sql erstellen -lambda-join/37472916 # 37472916 –
Sie sind herzlich willkommen @ JeremyMiller, froh, dass geholfen hat! –