Adoxio / xRM-Portals-Community-Edition

The definitive edition of Microsoft Open Source Portals, supported by the experts in portals.
MIT License
107 stars 60 forks source link

Exception when viewing a blog post with query string #63

Closed amervitz closed 6 years ago

amervitz commented 6 years ago

When viewing a blog post with query strings in the URL, an unhandled exception is thrown:

The context can not load the related collection or reference for untracked entities while the 'MergeOption' is not set to 'NoTracking'. Change the 'MergeOption' to 'NoTracking' or attach the 'adx_blogpost' entity.

Line 760: var relatedEntity = entity.GetRelatedEntity<T>(relationship.SchemaName, relationship.PrimaryEntityRole);

Source File: C:\Source\Repos\xRM-Portals-Community-Edition\Framework\Microsoft.Xrm.Client\EntityExtensions.cs Line: 759

amervitz commented 6 years ago

Fixed by commit https://github.com/Adoxio/xRM-Portals-Community-Edition/commit/77dc1fae0f46c18453dc253ab0060230c73d60cb.