c# - Type or namespace name could not be found -
i use this:
public class constructionrepository { private crdatacontext db = new crdatacontext(); public iqueryable<material> findallmaterials() { //return db.materials; var materials = m in db.materials join mt in db.measurementtypes on m.measurementtypeid equals mt.id select new material { mat_name = m.mat_name, measurementtypeid = mt.name, mat_type = m.mat_type }; return materials.asqueryable(); } }
it gives me error
- 'crmvc.models.material' not contain definition 'matid','mesname','mestype'
edit: 'matid','mesname','mestype' fake names gave wrong..
the material class must have settable properties same names used in select new material { ... } clause, can't make these up.
Comments
Post a Comment