I am having problems saving an entity in my EF6 context, I have tried it in several ways and in 1 it does not give an error but it does not save, the other gives an error.
var RegistroProducto = new tblProductos()
{
Estado = true,
FechaInsercion = FechaRegistro,
SKU = NoIdentificacion,
Referencia = Referencia,
};
Tienda.tblProductos.Add(RegistroProducto);
dbContext.SaveChanges();
This code does not give an error but does not save any changes in the db.
var RegistroProducto = new tblProductos()
{
tblTienda = Tienda,
Estado = true,
FechaInsercion = FechaRegistro,
SKU = NoIdentificacion,
Referencia = Referencia,
};
dbContext.tblProductos.Add(RegistroProducto);
dbContext.SaveChanges();
This code gives the following error: "An entity object can not be referenced by multiple instances of IEntityChangeTracker."
Any ideas?