c# - Entity Framework Error when no records are returned -
.net framework 4 | sql server 2008 | entity framework 6
i calling function import calls stored procedure , creates complex object. in cases result 0 records. seems if have case columns in complex object must set allow nulls. don't want because, if there records, non of columns null. causing me have check nulls on of these fields instead of checking if returned list has rows.
am doing wrong or way ef set up?
update:
i'm not sure code want. it's simple select statement. stored procedure call through regular function import. here's how calling that:
// district entity list<schoolcollectionsummary_result> summaries = context.getschoolcollectionsummary( schoolyear.schoolyearid, districtorganizationid, schoolorganizationid).tolist();
schoolcollectionsummary_result complex type (entity) based on stored procedure.
as enumerate error occurs:
{"the 'schoolcollectionid' property on 'schoolcollectionsummary_result' not set 'null' value. must set property non-null value of type 'system.int32'. "}
i set fields "allow null = false" because database fields set not null.
thanks.
update
thanks asking sql. when looking through noticed there's left join cause of problems...
Comments
Post a Comment