Binding a List<EntityObject> to Ext Store fails when there are association between EntityObjects in .Net Framework 4 Build. However the same thing works with .Net framework 3.5 build.

Below are the Parent Child EntityObjects and Complete StackTrace


Regards
Prolay


EntityObject - Parent
---------------------

[EdmEntityTypeAttribute(NamespaceName = "Model", Name = "SaleLineItem")]
[Serializable()]
[DataContractAttribute(IsReference = true)]
public partial class SaleLineItem : EntityObject
{
#region Factory Method

/// <summary>
/// Create a new SaleLineItem object.
/// </summary>
/// <param name="lineItemID">Initial value of the LineItemID property.</param>
public static SaleLineItem CreateSaleLineItem(global::System.Int32 lineItemID)
{
SaleLineItem SaleLineItem = new SaleLineItem();
SaleLineItem.LineItemID = lineItemID;
return SaleLineItem;
}

#endregion
#region Primitive Properties

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
[DataMemberAttribute()]
public global::System.Int32 LineItemID
{
get
{
return _LineItemID;
}
set
{
if (_LineItemID != value)
{
OnLineItemIDChanging(value);
ReportPropertyChanging("LineItemID");
_LineItemID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("LineItemID");
OnLineItemIDChanged();
}
}
}
private global::System.Int32 _LineItemID;
partial void OnLineItemIDChanging(global::System.Int32 value);
partial void OnLineItemIDChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Int32> SaleID
{
get
{
return _SaleID;
}
set
{
OnSaleIDChanging(value);
ReportPropertyChanging("SaleID");
_SaleID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("SaleID");
OnSaleIDChanged();
}
}
private Nullable<global::System.Int32> _SaleID;
partial void OnSaleIDChanging(Nullable<global::System.Int32> value);
partial void OnSaleIDChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public global::System.String LineItemTAG
{
get
{
return _LineItemTAG;
}
set
{
OnLineItemTAGChanging(value);
ReportPropertyChanging("LineItemTAG");
_LineItemTAG = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("LineItemTAG");
OnLineItemTAGChanged();
}
}
private global::System.String _LineItemTAG;
partial void OnLineItemTAGChanging(global::System.String value);
partial void OnLineItemTAGChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public global::System.String Description
{
get
{
return _Description;
}
set
{
OnDescriptionChanging(value);
ReportPropertyChanging("Description");
_Description = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("Description");
OnDescriptionChanged();
}
}
private global::System.String _Description;
partial void OnDescriptionChanging(global::System.String value);
partial void OnDescriptionChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> OriginalCost
{
get
{
return _OriginalCost;
}
set
{
OnOriginalCostChanging(value);
ReportPropertyChanging("OriginalCost");
_OriginalCost = StructuralObject.SetValidValue(value);
ReportPropertyChanged("OriginalCost");
OnOriginalCostChanged();
}
}
private Nullable<global::System.Decimal> _OriginalCost;
partial void OnOriginalCostChanging(Nullable<global::System.Dec imal> value);
partial void OnOriginalCostChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> OriginalListPrice
{
get
{
return _OriginalListPrice;
}
set
{
OnOriginalListPriceChanging(value);
ReportPropertyChanging("OriginalListPrice");
_OriginalListPrice = StructuralObject.SetValidValue(value);
ReportPropertyChanged("OriginalListPrice");
OnOriginalListPriceChanged();
}
}
private Nullable<global::System.Decimal> _OriginalListPrice;
partial void OnOriginalListPriceChanging(Nullable<global::Syste m.Decimal> value);
partial void OnOriginalListPriceChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Double> MDPPercent
{
get
{
return _MDPPercent;
}
set
{
OnMDPPercentChanging(value);
ReportPropertyChanging("MDPPercent");
_MDPPercent = StructuralObject.SetValidValue(value);
ReportPropertyChanged("MDPPercent");
OnMDPPercentChanged();
}
}
private Nullable<global::System.Double> _MDPPercent;
partial void OnMDPPercentChanging(Nullable<global::System.Doubl e> value);
partial void OnMDPPercentChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Double> AddedPercent
{
get
{
return _AddedPercent;
}
set
{
OnAddedPercentChanging(value);
ReportPropertyChanging("AddedPercent");
_AddedPercent = StructuralObject.SetValidValue(value);
ReportPropertyChanged("AddedPercent");
OnAddedPercentChanged();
}
}
private Nullable<global::System.Double> _AddedPercent;
partial void OnAddedPercentChanging(Nullable<global::System.Dou ble> value);
partial void OnAddedPercentChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> FreightCost
{
get
{
return _FreightCost;
}
set
{
OnFreightCostChanging(value);
ReportPropertyChanging("FreightCost");
_FreightCost = StructuralObject.SetValidValue(value);
ReportPropertyChanged("FreightCost");
OnFreightCostChanged();
}
}
private Nullable<global::System.Decimal> _FreightCost;
partial void OnFreightCostChanging(Nullable<global::System.Deci mal> value);
partial void OnFreightCostChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> SetupCost
{
get
{
return _SetupCost;
}
set
{
OnSetupCostChanging(value);
ReportPropertyChanging("SetupCost");
_SetupCost = StructuralObject.SetValidValue(value);
ReportPropertyChanged("SetupCost");
OnSetupCostChanged();
}
}
private Nullable<global::System.Decimal> _SetupCost;
partial void OnSetupCostChanging(Nullable<global::System.Decima l> value);
partial void OnSetupCostChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> DeliveryCost
{
get
{
return _DeliveryCost;
}
set
{
OnDeliveryCostChanging(value);
ReportPropertyChanging("DeliveryCost");
_DeliveryCost = StructuralObject.SetValidValue(value);
ReportPropertyChanged("DeliveryCost");
OnDeliveryCostChanged();
}
}
private Nullable<global::System.Decimal> _DeliveryCost;
partial void OnDeliveryCostChanging(Nullable<global::System.Dec imal> value);
partial void OnDeliveryCostChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> AddtlParts
{
get
{
return _AddtlParts;
}
set
{
OnAddtlPartsChanging(value);
ReportPropertyChanging("AddtlParts");
_AddtlParts = StructuralObject.SetValidValue(value);
ReportPropertyChanged("AddtlParts");
OnAddtlPartsChanged();
}
}
private Nullable<global::System.Decimal> _AddtlParts;
partial void OnAddtlPartsChanging(Nullable<global::System.Decim al> value);
partial void OnAddtlPartsChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> FinanceCost
{
get
{
return _FinanceCost;
}
set
{
OnFinanceCostChanging(value);
ReportPropertyChanging("FinanceCost");
_FinanceCost = StructuralObject.SetValidValue(value);
ReportPropertyChanged("FinanceCost");
OnFinanceCostChanged();
}
}
private Nullable<global::System.Decimal> _FinanceCost;
partial void OnFinanceCostChanging(Nullable<global::System.Deci mal> value);
partial void OnFinanceCostChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> PartialOrFinalPayout
{
get
{
return _PartialOrFinalPayout;
}
set
{
OnPartialOrFinalPayoutChanging(value);
ReportPropertyChanging("PartialOrFinalPayout");
_PartialOrFinalPayout = StructuralObject.SetValidValue(value);
ReportPropertyChanged("PartialOrFinalPayout");
OnPartialOrFinalPayoutChanged();
}
}
private Nullable<global::System.Decimal> _PartialOrFinalPayout;
partial void OnPartialOrFinalPayoutChanging(Nullable<global::Sy stem.Decimal> value);
partial void OnPartialOrFinalPayoutChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public global::System.String Comments
{
get
{
return _Comments;
}
set
{
OnCommentsChanging(value);
ReportPropertyChanging("Comments");
_Comments = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("Comments");
OnCommentsChanged();
}
}
private global::System.String _Comments;
partial void OnCommentsChanging(global::System.String value);
partial void OnCommentsChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> AddtlAdjusts
{
get
{
return _AddtlAdjusts;
}
set
{
OnAddtlAdjustsChanging(value);
ReportPropertyChanging("AddtlAdjusts");
_AddtlAdjusts = StructuralObject.SetValidValue(value);
ReportPropertyChanged("AddtlAdjusts");
OnAddtlAdjustsChanged();
}
}
private Nullable<global::System.Decimal> _AddtlAdjusts;
partial void OnAddtlAdjustsChanging(Nullable<global::System.Dec imal> value);
partial void OnAddtlAdjustsChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> POSellPrice
{
get
{
return _POSellPrice;
}
set
{
OnPOSellPriceChanging(value);
ReportPropertyChanging("POSellPrice");
_POSellPrice = StructuralObject.SetValidValue(value);
ReportPropertyChanged("POSellPrice");
OnPOSellPriceChanged();
}
}
private Nullable<global::System.Decimal> _POSellPrice;
partial void OnPOSellPriceChanging(Nullable<global::System.Deci mal> value);
partial void OnPOSellPriceChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Decimal> FinalPayout
{
get
{
return _FinalPayout;
}
set
{
OnFinalPayoutChanging(value);
ReportPropertyChanging("FinalPayout");
_FinalPayout = StructuralObject.SetValidValue(value);
ReportPropertyChanged("FinalPayout");
OnFinalPayoutChanged();
}
}
private Nullable<global::System.Decimal> _FinalPayout;
partial void OnFinalPayoutChanging(Nullable<global::System.Deci mal> value);
partial void OnFinalPayoutChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.DateTime> FinalPayoutDate
{
get
{
return _FinalPayoutDate;
}
set
{
OnFinalPayoutDateChanging(value);
ReportPropertyChanging("FinalPayoutDate");
_FinalPayoutDate = StructuralObject.SetValidValue(value);
ReportPropertyChanged("FinalPayoutDate");
OnFinalPayoutDateChanged();
}
}
private Nullable<global::System.DateTime> _FinalPayoutDate;
partial void OnFinalPayoutDateChanging(Nullable<global::System. DateTime> value);
partial void OnFinalPayoutDateChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Boolean> FinalPaid
{
get
{
return _FinalPaid;
}
set
{
OnFinalPaidChanging(value);
ReportPropertyChanging("FinalPaid");
_FinalPaid = StructuralObject.SetValidValue(value);
ReportPropertyChanged("FinalPaid");
OnFinalPaidChanged();
}
}
private Nullable<global::System.Boolean> _FinalPaid;
partial void OnFinalPaidChanging(Nullable<global::System.Boolea n> value);
partial void OnFinalPaidChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Boolean> PartialPaid
{
get
{
return _PartialPaid;
}
set
{
OnPartialPaidChanging(value);
ReportPropertyChanging("PartialPaid");
_PartialPaid = StructuralObject.SetValidValue(value);
ReportPropertyChanged("PartialPaid");
OnPartialPaidChanged();
}
}
private Nullable<global::System.Boolean> _PartialPaid;
partial void OnPartialPaidChanging(Nullable<global::System.Bool ean> value);
partial void OnPartialPaidChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.Boolean> TradeBeingSold
{
get
{
return _TradeBeingSold;
}
set
{
OnTradeBeingSoldChanging(value);
ReportPropertyChanging("TradeBeingSold");
_TradeBeingSold = StructuralObject.SetValidValue(value);
ReportPropertyChanged("TradeBeingSold");
OnTradeBeingSoldChanged();
}
}
private Nullable<global::System.Boolean> _TradeBeingSold;
partial void OnTradeBeingSoldChanging(Nullable<global::System.B oolean> value);
partial void OnTradeBeingSoldChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public Nullable<global::System.DateTime> PartialPayoutDate
{
get
{
return _PartialPayoutDate;
}
set
{
OnPartialPayoutDateChanging(value);
ReportPropertyChanging("PartialPayoutDate");
_PartialPayoutDate = StructuralObject.SetValidValue(value);
ReportPropertyChanged("PartialPayoutDate");
OnPartialPayoutDateChanged();
}
}
private Nullable<global::System.DateTime> _PartialPayoutDate;
partial void OnPartialPayoutDateChanging(Nullable<global::Syste m.DateTime> value);
partial void OnPartialPayoutDateChanged();

#endregion

#region Navigation Properties

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("Model" , "FK_SaleLineItem_SaleType", "SaleType")]
public SaleType SaleType {
get
{
return ((IEntityWithRelationships)this).RelationshipManag er.GetRelatedReference<SaleType>("Model.FK_SaleLin eItem_SaleType", "SaleType").Value;
}
set
{
((IEntityWithRelationships)this).RelationshipManag er.GetRelatedReference<SaleType>("Model.FK_SaleLin eItem_SaleType", "SaleType").Value = value;
}
}
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[BrowsableAttribute(false)]
[DataMemberAttribute()]
public EntityReference<SaleType> SaleTypeReference
{
get
{
return ((IEntityWithRelationships)this).RelationshipManag er.GetRelatedReference<SaleType>("Model.FK_SaleLin eItem_SaleType", "SaleType");
}
set
{
if ((value != null))
{
((IEntityWithRelationships)this).RelationshipManag er.InitializeRelatedReference<SaleType>("Model.FK_ SaleLineItem_SaleType", "SaleType", value);
}
}
}

#endregion
}

EntityObject - Child
--------------------

[EdmEntityTypeAttribute(NamespaceName = "Model", Name = "SaleType")]
[Serializable()]
[DataContractAttribute(IsReference = true)]
public partial class SaleType : EntityObject
{
#region Factory Method

/// <summary>
/// Create a new SaleType object.
/// </summary>
/// <param name="saleTypeID">Initial value of the SaleTypeID property.</param>
public static SaleType CreateSaleType(global::System.Int32 saleTypeID)
{
SaleType SaleType = new SaleType();
SaleType.SaleTypeID = saleTypeID;
return SaleType;
}

#endregion
#region Primitive Properties

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
[DataMemberAttribute()]
public global::System.Int32 SaleTypeID
{
get
{
return _SaleTypeID;
}
set
{
if (_SaleTypeID != value)
{
OnSaleTypeIDChanging(value);
ReportPropertyChanging("SaleTypeID");
_SaleTypeID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("SaleTypeID");
OnSaleTypeIDChanged();
}
}
}
private global::System.Int32 _SaleTypeID;
partial void OnSaleTypeIDChanging(global::System.Int32 value);
partial void OnSaleTypeIDChanged();

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
[DataMemberAttribute()]
public global::System.String SaleTypeName
{
get
{
return _SaleTypeName;
}
set
{
OnSaleTypeNameChanging(value);
ReportPropertyChanging("SaleTypeName");
_SaleTypeName = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("SaleTypeName");
OnSaleTypeNameChanged();
}
}
private global::System.String _SaleTypeName;
partial void OnSaleTypeNameChanging(global::System.String value);
partial void OnSaleTypeNameChanged();

#endregion

#region Navigation Properties

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("Model" , "FK_SaleLineItem_SaleType", "SaleLineItem")]
public EntityCollection<SaleLineItem> SaleLineItem {
get
{
return ((IEntityWithRelationships)this).RelationshipManag er.GetRelatedCollection<SaleLineItem>("Model.FK_Sa leLineItem_SaleType", "SaleLineItem");
}
set
{
if ((value != null))
{
((IEntityWithRelationships)this).RelationshipManag er.InitializeRelatedCollection<SaleLineItem>("Mode l.FK_SaleLineItem_SaleType", "SaleLineItem", value);
}
}
}

#endregion
}


Stack Trace
-----------
at System.Reflection.RuntimeMethodInfo.CheckConsisten cy(Object target)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Newtonsoft.Json.Serialization.JsonContract.InvokeO nSerializing(Object o, StreamingContext context)
at Newtonsoft.Json.Serialization.JsonSerializerIntern alWriter.SerializeList(JsonWriter writer, IList values, JsonArrayContract contract, JsonProperty member)
at Newtonsoft.Json.Serialization.JsonSerializerIntern alWriter.SerializeValue(JsonWriter writer, Object value, JsonProperty member, JsonContract contract)
at Newtonsoft.Json.Serialization.JsonSerializerIntern alWriter.WriteMemberInfoProperty(JsonWriter writer, Object memberValue, JsonProperty property, JsonContract contract)
at Newtonsoft.Json.Serialization.JsonSerializerIntern alWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member)
at Newtonsoft.Json.Serialization.JsonSerializerIntern alWriter.SerializeValue(JsonWriter writer, Object value, JsonProperty member, JsonContract contract)
at Newtonsoft.Json.Serialization.JsonSerializerIntern alWriter.Serialize(JsonWriter jsonWriter, Object value)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(J sonWriter jsonWriter, Object value)
at Newtonsoft.Json.JsonSerializer.Serialize(JsonWrite r jsonWriter, Object value)
at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Formatting formatting, JsonSerializerSettings settings)
at Ext.Net.JSON.Serialize(Object obj, Formatting formatting, List`1 converters, Boolean quoteName, IContractResolver resolver)
at Ext.Net.JSON.Serialize(Object obj, List`1 converters, Boolean quoteName, IContractResolver resolver)
at Ext.Net.JSON.Serialize(Object obj)
at Ext.Net.StoreDataBound.BindRecord(AutoGeneratedFie ldProperties[] autoFieldProperties, StringBuilder sb, Object obj)
at Ext.Net.StoreDataBound.PerformDataBinding(IEnumera ble data)
at Ext.Net.StoreDataBound.OnSelect(IEnumerable data)
at System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback)
at Ext.Net.StoreDataBound.PerformSelect()
at Ext.Net.StoreDataBound.DataBind()
at FillmoreCA.LineItems.LoadAllSalesLineItems() in D:\EFEval\FillmoreCAEntityFramework\FillmoreCA\Lin eItems.aspx.cs:line 200