0
I have a Query table that has two foreign keys (Client and Procedure).
to add a new query I can normally, but when editing it does not change my Client or Procedure the other fields modifies normally.
public static void EditarConsulta(Consulta entrada)
{
try
{
using (ConsultorioContext ctx = new ConsultorioContext())
{
ctx.Entry(entrada).State = EntityState.Modified;
ctx.SaveChanges();
}
}
catch (Exception)
{
}
}
other ways I’ve tried:
ctx.ChangeTracker.Entries<Consulta>().First(x => x.Entity == entrada).State = EntityState.Modified;
ctx.Entry<Consulta>(entrada).State = System.Data.Entity.EntityState.Modified;