We have a custom application that uses a V4 OData code generated class file for all dynamics entities in our tenant.  This application currently uses older versions of NuGet packages - Microsoft.OData.Client, Microsoft.OData.Core, Microsoft.OData.Edm version 6.14.

I was able to successfully upgrade to the current versions of each of these packages and apply minor updates to the generated class file.  But I'm finding an error when attempting to retrieve Picklist Attributes using this code:

var picklists = _unitOfWork.Context.EntityDefinitions
.ByKey(entityMetadataId)
.Attributes
.Expand("OptionSet")
.OfType<PicklistAttributeMetadata>()
.ToList();

The error is thrown on the "ToList()".  Using Fiddler, I can see that the request is made properly to the WebAPI and that results are returned.  But I have no idea why there is suddenly an error with code that was working with the previous version of the NuGet packages.

The error message is "The value returned by the 'Properties' property cannot be modified until the end of the owning resource is reported by the reader".  I tried googling this error message, but nothing helpful so far.  Any thoughts?