I believe I found the issue and wanted to post it for anyone who stumbles upon this in the future.
The assumption I am taking is that you used the OData Generator to create the ODataClient and EDMX data for the entities.
In my case we had a custom view that was created which linked a few tables together and exposed that data via an entity. This enabled us to consume it externally, but we kept seeing random issues on a custom application. We would step through it and even though the data in a web browser or postman was valid it wasn't valid in the custom application.
Once I had discovered this entity is using an underlying view and due to my lack of knowledge on development practices. I opted to NOT change anything on the entity/view.
Upon further digging a lot of people are suggesting that the METADATA that supplied the ODataClient and EDMX data was the source of the issue. Upon looking at the file and searching for the entity in question it was immediately obvious that this was the issue because it had only detected 3 of the 5 primary keys. I manually edited the generated ODataClient.cs in a few spots
1. Updated Key list
[global::Microsoft.OData.Client.Key("primary", "column", "name")]
[global::Microsoft.OData.Client.EntitySet("ABCEntityName")]
[global::Microsoft.OData.Client.OriginalNameAttribute("ABCEntityName")]
public partial class ABCEntityName : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
specifically the first line was change from [global::Microsoft.OData.Client.Key("primary", "column", "name") to [global::Microsoft.OData.Client.Key("primary", "column", "name", "goes", "here")
2. Updated Constructor
From:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
public static ABCEntityName CreateABCEntityName(string primary,
string column,
string name)
{
ABCEntityName aBCEntityName = new ABCEntityName();
aBCEntityName.primary = primary;
aBCEntityName.column = column;
aBCEntityName.name = name;
return aBCEntityName ;
}
To:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
public static ABCEntityName CreateABCEntityName(string primary,
string column,
string name,
string goes,
string here)
{
ABCEntityName aBCEntityName = new ABCEntityName();
aBCEntityName.primary = primary;
aBCEntityName.column = column;
aBCEntityName.name = name;
aBCEntityName.name = goes;
aBCEntityName.name = here;
return aBCEntityName ;
}
3. Updated
From:
public static global::ODataUtility.Microsoft.Dynamics.DataEntities.ABCEntityNameSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataUtility.Microsoft.Dynamics.DataEntities.ABCEntityName> source,
string primary,
string column,
string name,
{
global::System.Collections.Generic.Dictionary<string, object> keys = new global::System.Collections.Generic.Dictionary<string, object>
{
{ "primary", primary },
{ "column", column },
{ "name", name },
};
To:
public static global::ODataUtility.Microsoft.Dynamics.DataEntities.ABCEntityNameSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataUtility.Microsoft.Dynamics.DataEntities.ABCEntityName> source,
string primary,
string column,
string name,
string goes,
string here)
{
global::System.Collections.Generic.Dictionary<string, object> keys = new global::System.Collections.Generic.Dictionary<string, object>
{
{ "primary", primary },
{ "column", column },
{ "name", name },
{ "goes", goes },
{ "here", here }
};
4. Update EDMX Data
From:
<EntityType Name=""ABCEntityName"">
<Key>
<PropertyRef Name=""primary"" />
<PropertyRef Name=""column"" />
<PropertyRef Name=""name"" />
</Key>
To:
<EntityType Name=""ABCEntityName"">
<Key>
<PropertyRef Name=""primary"" />
<PropertyRef Name=""column"" />
<PropertyRef Name=""name"" />
<PropertyRef Name=""goes"" />
<PropertyRef Name=""here"" />
</Key>