I am using Entity Developer v5.8.803, Entity Framework 6 and MySQL
And using Domain WCF RIA service template, the insert code in the DataModelDomainService.cs is:
Code: Select all
public void InsertColor(Color color)
{
this.DbContext.Colores.Add(color);
this.DbContext.SaveChanges();
}
Code: Select all
public void UpdateColor(Color currentColor)
{
this.DbContext.Entry(currentColor).State = EntityState.Modified;
this.DbContext.SaveChanges();
}
There is already an open DataReader associated with this Connection which must be closed first.
And when I use this other code
Code: Select all
public void UpdateColor(Color currentColor)
{
this.DbContext.Colores.AttachAsModified(currentColor, this.DbContext);
}
Attempt by security transparent method 'System.ServiceModel.DomainServices.EntityFramework.DbContextExtensions.AttachAsModified(System.Data.Entity.DbSet`1<!!0>, !!0, System.Data.Entity.DbContext)' to access security critical method
I don't know what is happening