EntityFramework.Utilities icon indicating copy to clipboard operation
EntityFramework.Utilities copied to clipboard

EFBatchOperation.InsertAll "Sequence contains no element"

Open ms92ita opened this issue 8 years ago • 1 comments

Hi,

I have found this issue when i was trying to call InsertAll function. The error thrown was "Sequence contains no element" at row 192 of MappingHelper, when withCondition doesn't have elements tableMapping.TPHConfiguration = new TPHConfiguration { ColumnName = withConditions.First().Fragments[0].Conditions[0].Column.Name, Mappings = new Dictionary<Type, string>() };

IMHO this error occurs when the model has a related inheritance, but the inheritance type is not of TPH pattern, but for example a TPT inheritance. I have written my context in code-first mode and, for some needs, i have to implement this inheritance. I have downloaded the source code and, at the moment, I have modified the code so as I will use the library anyway (i have only checked if withConditions has elements), but if anyone who knows better EF model mapping has a solution for this problem, this is appreciated.

Thanks is advance

ms92ita avatar Mar 03 '16 13:03 ms92ita

i have same issue

miguelcaravantes avatar Mar 09 '16 23:03 miguelcaravantes