c# - Type interference in the call join -
i have built short , sweet join query try , feel on how create join. managed in sql. i'm not sure how in linq.
linq:
public iqueryable<departmentbreakdownreport> getdepartmentbreakdown (int supplierid, int reviewperiodid) { return (from detail in camonlinedb.details join suppdepp in camonlinedb.suppdepts on new { detail.clientid, detail.categoryid } equals new { suppdepp.clientid, suppdepp.categoryid } select detail.clientid + "" + detail.categoryid); }
edit: ignore parameters brought in, cater once have join working.
you returning iqueryable<string>
rather assume want iqueryable<departmentbreakdownreport>
. return type, need project in select
specifying type, this:
return (from detail in camonlinedb.details join suppdepp in camonlinedb.suppdepts on new { detail.clientid, detail.categoryid } equals new { suppdepp.clientid, suppdepp.categoryid } select new departmentbreakdownreport { property1 = detail.property1, //your properties here });
Comments
Post a Comment