c# - Entityframework.extensions error "Sequence contains more than one element" on batch delete -



c# - Entityframework.extensions error "Sequence contains more than one element" on batch delete -

i using entityframework.extended library in project, contains code first entity model. receiving error message "sequence contains more 1 element" when execute linq statement , perform batch delete library:

var subjlocal = (from subjectlocal in customercontext.rostersummarydata_subject_local ((subjectlocal.fkrostersetid == 0) && (statsinfo.testinstanceidslist.contains(subjectlocal.fktestinstanceid)) && (subjectlocal.fktesttypeid == statsinfo.testtypeid) && (statsinfo.schoolyearidslist.contains(subjectlocal.fkschoolyearid)) && (subjectlocal.fkrostertypeid == 1) && (subjectlocal.fkschoolid == 0) && (subjectlocal.fkdepartmentid == 1) && (subjectlocal.fkcourseid == 1) && (subjectlocal.fkperiodid == 1) && (statsinfo.democatidslist.contains(subjectlocal.fkdemocommoncategoryid)) && (statsinfo.democodeidslist.contains(subjectlocal.fkdemocommoncodeid)) && (statsinfo.testsubjectidslist.contains(subjectlocal.fktest_subjectid))) select subjectlocal.pksummarysubjectlocalid).toarray(); if (subjlocal.length > 0) { customercontext.rostersummarydata_subject_local.where(s => subjlocal.contains(s.pksummarysubjectlocalid)).delete(); customercontext.rostersummarydata_subject_local_bands.where(s => subjlocal.contains(s.fksummarysubjectlocalid)).delete(); customercontext.rostersummarydata_subject_local_averages.where(s => subjlocal.contains(s.fksummarysubjectlocalid)).delete(); customercontext.savechanges(); }

the error occurs at:

customercontext.rostersummarydata_subject_local.where(s => subjlocal.contains(s.pksummarysubjectlocalid)).delete();

customercontext base of operations entity inheriting dbcontext , rostersummarydata_subject_local / _bands / _averages kid tables. importing library using reference , notices delete() method works properly:

using entityframework.extensions;

isn't purpose of batch delete create sure can delete multiple items @ 1 time , shouldn't sequence contain more 1 element? there missing here?

you can find similar post entityframework.extensions 6.1 batch delete throws "sequence contains more 1 element" here.

according @deherech seems bug in extension framework

c# linq entity-framework

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -