This question is locked. New answers and comments are not allowed.
I am using multiple joins in a LINQ query to get the data out of multiple classes.
Here is my Query,
Dim AmPropertyAddress = (From AmericanPropAddress In scope.Extent(Of AmericanPropertyAddress)()
Join PropertyAddressAssoc In scope.Extent(Of PropertyAddressAssociation)() On AmericanPropAddress.id Equals PropertyAddressAssoc.urbanPropertyAddress.id
Where AmericanPropAddress.id = PlaceID
Join GeographicLocationRelation In scope.Extent(Of GeographicLocationRelationship)() On PropertyAddressAssoc.propertyEntity.id Equals GeographicLocationRelation.toGeographicLocation.id
Join ExchangeService In scope.Extent(Of ExchangeServiceArea)() On GeographicLocationRelation.fromGeographicLocation.id Equals ExchangeService.id
Select New With {.StNumber = AmericanPropAddress.streetNrFirst,
.StNamePfix = AmericanPropAddress.streetNamePrefix,
.StName = AmericanPropAddress.streetName,
.StType = AmericanPropAddress.streetType,
.StSuffix = AmericanPropAddress.streetSuffix,
.StCity = AmericanPropAddress.locality,
.StState = AmericanPropAddress.stateOrProvince,
.StCountry = AmericanPropAddress.country,
.StZip = AmericanPropAddress.postcode,
.StNPANXX = ExchangeService.code}).ToList()
Return AmPropertyAddress
But i am getting this error:
An exception occured during the execution of '
Extent<Core180.AmericanPropertyAddress>.Join(Extent<Core180.PropertyAddressAssociation>, AmericanPropAddress => AmericanPropAddress.id, PropertyAddressAssoc => PropertyAddressAssoc.urbanPropertyAddress.id, (AmericanPropAddress, PropertyAddressAssoc) => new VB$AnonymousType_4`2(AmericanPropAddress = AmericanPropAddress, PropertyAddressAssoc = PropertyAddressAssoc)).Where($VB$It => ($VB$It.AmericanPropAddress.id == value(Core180BLL.PlaceBLL+_Closure$__7).$VB$Local_PlaceID)).Join(Extent<Core180.GeographicLocationRelationship>, $VB$It => $VB$It.PropertyAddressAssoc.propertyEntity.id, GeographicLocationRelation => GeographicLocationRelation.toGeographicLocation.id, ($VB$It1, GeographicLocationRelation) => new VB$AnonymousType_5`2($VB$It1 = $VB$It1, GeographicLocationRelation = GeographicLocationRelation)).Join(Extent<Core180.ExchangeServiceArea>, $VB$It => $VB$It.GeographicLocationRelation.fromGeographicLocation.id, ExchangeService => ExchangeService.id, ($VB$It1, ExchangeService) => new VB$AnonymousType_6`11(StNumber = $VB$It1.$VB$It1.AmericanPropAddress.streetNrFirst, StNamePfix = $VB$It1.$VB$It1.AmericanPropAddress.streetNamePrefix, StName = $VB$It1.$VB$It1.AmericanPropAddress.streetName, StType = $VB$It1.$VB$It1.AmericanPropAddress.streetType, StSuffix = $VB$It1.$VB$It1.AmericanPropAddress.streetSuffix, StLATA = $VB$It1.$VB$It1.AmericanPropAddress.locality, StCity = $VB$It1.$VB$It1.AmericanPropAddress.locality, StState = $VB$It1.$VB$It1.AmericanPropAddress.stateOrProvince, StCountry = $VB$It1.$VB$It1.AmericanPropAddress.country, StZip = $VB$It1.$VB$It1.AmericanPropAddress.postcode, StNPANXX = ExchangeService.code))'. See InnerException for more details.
The Inner Exception is :
{"Could not load type 'VB+AnonymousType_4`2' from assembly 'Telerik.OpenAccess.Runtime, Version=2010.3.1125.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342'.":"VB+AnonymousType_4`2"}
I don't know how to resolve this, please help me.
Thanks in advance.
Here is my Query,
Dim AmPropertyAddress = (From AmericanPropAddress In scope.Extent(Of AmericanPropertyAddress)()
Join PropertyAddressAssoc In scope.Extent(Of PropertyAddressAssociation)() On AmericanPropAddress.id Equals PropertyAddressAssoc.urbanPropertyAddress.id
Where AmericanPropAddress.id = PlaceID
Join GeographicLocationRelation In scope.Extent(Of GeographicLocationRelationship)() On PropertyAddressAssoc.propertyEntity.id Equals GeographicLocationRelation.toGeographicLocation.id
Join ExchangeService In scope.Extent(Of ExchangeServiceArea)() On GeographicLocationRelation.fromGeographicLocation.id Equals ExchangeService.id
Select New With {.StNumber = AmericanPropAddress.streetNrFirst,
.StNamePfix = AmericanPropAddress.streetNamePrefix,
.StName = AmericanPropAddress.streetName,
.StType = AmericanPropAddress.streetType,
.StSuffix = AmericanPropAddress.streetSuffix,
.StCity = AmericanPropAddress.locality,
.StState = AmericanPropAddress.stateOrProvince,
.StCountry = AmericanPropAddress.country,
.StZip = AmericanPropAddress.postcode,
.StNPANXX = ExchangeService.code}).ToList()
Return AmPropertyAddress
But i am getting this error:
An exception occured during the execution of '
Extent<Core180.AmericanPropertyAddress>.Join(Extent<Core180.PropertyAddressAssociation>, AmericanPropAddress => AmericanPropAddress.id, PropertyAddressAssoc => PropertyAddressAssoc.urbanPropertyAddress.id, (AmericanPropAddress, PropertyAddressAssoc) => new VB$AnonymousType_4`2(AmericanPropAddress = AmericanPropAddress, PropertyAddressAssoc = PropertyAddressAssoc)).Where($VB$It => ($VB$It.AmericanPropAddress.id == value(Core180BLL.PlaceBLL+_Closure$__7).$VB$Local_PlaceID)).Join(Extent<Core180.GeographicLocationRelationship>, $VB$It => $VB$It.PropertyAddressAssoc.propertyEntity.id, GeographicLocationRelation => GeographicLocationRelation.toGeographicLocation.id, ($VB$It1, GeographicLocationRelation) => new VB$AnonymousType_5`2($VB$It1 = $VB$It1, GeographicLocationRelation = GeographicLocationRelation)).Join(Extent<Core180.ExchangeServiceArea>, $VB$It => $VB$It.GeographicLocationRelation.fromGeographicLocation.id, ExchangeService => ExchangeService.id, ($VB$It1, ExchangeService) => new VB$AnonymousType_6`11(StNumber = $VB$It1.$VB$It1.AmericanPropAddress.streetNrFirst, StNamePfix = $VB$It1.$VB$It1.AmericanPropAddress.streetNamePrefix, StName = $VB$It1.$VB$It1.AmericanPropAddress.streetName, StType = $VB$It1.$VB$It1.AmericanPropAddress.streetType, StSuffix = $VB$It1.$VB$It1.AmericanPropAddress.streetSuffix, StLATA = $VB$It1.$VB$It1.AmericanPropAddress.locality, StCity = $VB$It1.$VB$It1.AmericanPropAddress.locality, StState = $VB$It1.$VB$It1.AmericanPropAddress.stateOrProvince, StCountry = $VB$It1.$VB$It1.AmericanPropAddress.country, StZip = $VB$It1.$VB$It1.AmericanPropAddress.postcode, StNPANXX = ExchangeService.code))'. See InnerException for more details.
The Inner Exception is :
{"Could not load type 'VB+AnonymousType_4`2' from assembly 'Telerik.OpenAccess.Runtime, Version=2010.3.1125.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342'.":"VB+AnonymousType_4`2"}
I don't know how to resolve this, please help me.
Thanks in advance.