So I have a grid that is populated from EF5
I recently added a new table to the database that has a FK to the FinancialInstitution table
I updated the model and the association and navigation are now present.
However, now I get the following error:
"A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.FinancialInstitution_1..."
I have found a few articles suggesting the disabling of proxy creation, but this doesn't seem to help.
I also found a blog that suggests a workaround however, I am confused as to whether or not I will have to do something every time a call is made to EF to rewire the JSON results
@model IEnumerable<HCS.Model.FinancialInstitution>
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.ID).Visible(false);
columns.Bound(p => p.MainRT).Title("RT").Groupable(false);
columns.Bound(p => p.LegalName).Title("FI Name");
})
.Sortable()
.Scrollable()
.Filterable()
.Selectable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false))
)
I updated the model and the association and navigation are now present.
However, now I get the following error:
"A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.FinancialInstitution_1..."
I have found a few articles suggesting the disabling of proxy creation, but this doesn't seem to help.
public ActionResult Grid()
{
context.Configuration.ProxyCreationEnabled = false;
var model = context.FinancialInstitutions.ToList();
return View();
}