Having an issue with trying to eagerly load related entities using Entity Framework:
Simple test code:
Code: Select all
var context = new SalesforceEF();
var contacts = context.Contacts.Include("Account").ToList();
var contacts2 = context.Contacts.Select(n => new {n, n.Account}).ToList();
Index was outside the bounds of the array.
Tried this using the LazyLoad ON or OFF at the EDMX level. Would appreciate any advice.at Devart.Data.Salesforce.ad.a(sObject A_0)
at Devart.Data.Salesforce.y.r(Int32 A_0)
at Devart.Data.Salesforce.SalesforceDataReader.IsDBNull(Int32 ordinal)
at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at System.Data.Common.Internal.Materialization.Shaper.GetPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at ClassLibrary1.Class1.test() in d:\Dev\Spikes\SalesforceBulkAPI\ClassLibrary1\Class1.cs:line 18