c# - The specified member 'ClaimTypeID' is not supported in LINQ to Entities -
at moment have error prevents me returning data database. past linq join , when hover on model holds data, states error message. did comment out few lines in join , worked have identified errors at. need understanding error , why occurs.
sql repository:
public iqueryable<claimnumberreport> getclaimsbyclaimnumber(int clientid, int claimid) { return (from d in camonlinedb.details join in camonlinedb.areas on new { = d.clientid, b = d.areaid ?? 0 } equals new { = a.clientid, b = a.areaid } d.clientid == clientid join r in camonlinedb.reasons on new { = d.clientid, b = d.reasonid ?? 0 } equals new { = r.clientid, b = r.reasonid } join sd in camonlinedb.suppdepts on new { = d.clientid, b = d.categoryid ?? 0 } equals new { = sd.clientid, b = sd.categoryid } join h in camonlinedb.headers on new { d.clientid, d.claimid } equals new { h.clientid, h.claimid } d.claimid == claimid join su in camonlinedb.suppliers on new { h.clientid, h.supplierid } equals new { su.clientid, su.supplierid } join cp in camonlinedb.claimpacks on new { h.clientid, h.claimid } equals new { cp.clientid, cp.claimid } join rev in camonlinedb.reviews on new { h.clientid, h.reviewid } equals new { rev.clientid, rev.reviewid } join revp in camonlinedb.reviewperiods on new { = rev.clientid, b = rev.reviewperiodid ?? 0 } equals new { = revp.clientid, b = revp.reviewperiodid } join st in camonlinedb.statuses on new { = d.clientid, b = d.statusid ?? 0 } equals new { = st.clientid, b = st.statusid } join stcm in camonlinedb.statuscategorymappings on new { st.clientid, st.statusid } equals new { stcm.clientid, stcm.statusid } join stc in camonlinedb.statuscategories on new { stcm.statuscategoryid } equals new { stc.statuscategoryid } select new claimnumberreport { // changed type sub type , dropped type typeid = d.claimtypeid, // needs changed pdf file address cpattached = cp.comment, reviewname = revp.reviewperiodname, claimid = d.claimid, line = d.claimline, accountno = su.accountno, suppliername = su.suppliername, amount = d.amount, status = st.statusdesc, datesent = d.datesent, dayos = d.daysos, nominalperiod = d.nominalperiod, slinvoiceno = d.slinvoiceno, area = a.areadesc, debitref = d.debitfile, debitdate = d.journaldate, deductdate = d.deductdate, statuscategorydesc = stc.statuscategorydesc, aplreason = r.reasondesc, deptno = sd.departmentid, deptname = sd.departmentname, // below 4 need change, believe may done on view or controller. //settled = d.amount, //cancelled = d.amount, //conversation = d.amount, //wip = d.amount }); } controller:
public actionresult claimnumberreportselection(int clientid, int claimno) { int claimid = convert.toint32(claimno); claimnumberviewmodel claimnumbermodel = new claimnumberviewmodel { reportdata = reportrepo.getclaimsbyclaimnumber(clientid, claimid), reporttitle = "claim number report", reportdescription = "report " //+ reportrepo.getclaimsbyclaimnumber(clientid, claimid).where(r => r.claimid == claimid).select(r => r.claimid).firstordefault() }; return view("claimnumberreport", claimnumbermodel); } claimnumberreportclass:
public class claimnumberreport { public int claimid { get; set; } public string reviewname { get; set; } public char? typeid { get; set; } public char oldtypeid { get; set; } public string cpattached { get; set; } public int? line { get; set; } public string accountno { get; set; } public string suppliername { get; set; } [datatype(datatype.currency)] public decimal? amount { get; set; } public string status { get; set; } public datetime? datesent { get; set; } public int? dayos { get; set; } public int? nominalperiod { get; set; } public string slinvoiceno { get; set; } public string area { get; set; } public string debitref { get; set; } public datetime? debitdate { get; set; } public datetime? deductdate { get; set; } public string statuscategorydesc { get; set; } public string aplreason { get; set; } public int clientid { get; set; } public int deptno { get; set; } public string deptname { get; set; } [datatype(datatype.currency)] public decimal settled { get; set; } [datatype(datatype.currency)] public decimal cancelled { get; set; } public decimal conversation { get; set; } [datatype(datatype.currency)] public decimal wip { get; set; } } it states error message 1 view , try display data shows error message when hover on return view line on model.
it datatype char. in database claimtypeid char. in visual studio char different sql char allowed 1 character. had change string instead.
Comments
Post a Comment