Mindscape 5.0.2587
Hi,
When I execute the linq query as shown below I get an Access Violation exception. The exception is not even caught in the try catch block. I tried rebooting my system, but without success.
public List<string> GetBsnWithIncomplete()
{
List<string> toReturn = null;
try
{
uow = Context.CreateUnitOfWork();
var y1 = from rec in uow.WgiImportRecords
join field1 in uow.WgiImportFields on rec.Id equals field1.WgiImportRecordId
join field2 in uow.WgiImportFields on rec.Id equals field2.WgiImportRecordId
where rec.WgiImportKopId == KopId && field1.Name == "BurgerServiceNummer" && field2.Name == "JaarMaand"
group new { field2.ValueDateTime } by new { field1.ValueNumber } into g
select new { Bsn = g.Key.ValueNumber, Aantal = g.Count(), MinPeriode = g.Min(f => f.ValueDateTime) };
var result = y1.ToList();
}
catch (Exception exception)
{
string iets = exception.Message;
}
return toReturn;
}
The stacktrace looks like this:
Result Message:
Test method Innovact.IVPA.WgiBusinessLayer.SOClasses.Tests.WgiKopRecordSOTests.GetBsnWithIncompleteTest threw exception:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Result StackTrace:
at getfastvalueNumber(Object )
at Mindscape.LightSpeed.Model.FieldModel.<>cDisplayClass4b.b__1d(Object target)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.GroupingField.GetValue(Object entity)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.GroupingSelector.GetValue(Object entity, IUnitOfWork unitOfWork)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.MultiKeyGroupingSelector.GetValue(Object entity, IUnitOfWork unitOfWork)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.GetAllGroupsAtOnce(IUnitOfWork unitOfWork, IList groupingKeys, IList interimKeys, List1 groupingOn, GroupResultsTypeHandler handler)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.FetchResultSetForMultipleGroupingKeys(IUnitOfWork unitOfWork, IList groupingKeys, IList interimKeys, GroupResultsTypeHandler handler)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType)
at Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression)
at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression)
at Mindscape.LightSpeed.Linq.LinqQuery
1.GetEnumerator()
at System.Collections.Generic.List1..ctor(IEnumerable
1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Innovact.IVPA.WgiBusinessLayer.SOClasses.WgiKopRecordSO.GetBsnWithIncomplete() in c:\Pirapps\ontw-tfs-02\InnovactProjecten\Innovact.IVPA\IVPA-Dev\WgiBusinessLayer\SOClasses\WgiKopRecordSO.cs:line 103
at Innovact.IVPA.WgiBusinessLayer.SOClasses.Tests.WgiKopRecordSOTests.GetBsnWithIncompleteTest() in c:\Pirapps\ontw-tfs-02\InnovactProjecten\Innovact.IVPA\IVPA-Dev\WgiBusinessLayerTests\SOClasses\WgiKopRecordSOTests.cs:line 54