Interbase error on SaveChangesAsync() Ibexception: dynamic sql error SQL error code = -206

33 views Asked by At

I have an IBException error when I am trying to delete. Insert is working, but Update and Delete are not. I used InterBaseSql. EntityFrameworkCore. InterBase version 7.13.7 I am stuck with this error. If anyone could help me, I would appreciate it. Thank you.

  public async Task Delete(long id, ContextSession session)
{
    var context = GetContext(session);

    using (IDbContextTransaction transaction = context.Database.BeginTransaction())
    {
        try
        {

            var itemToDelete = context.Table.Find(id);
            //context.Table.Remove(itemToDelete);
            context.Entry(itemToDelete).State = EntityState.Deleted;
          
            await context.SaveChangesAsync();
            await transaction.CommitAsync();
        }
        catch (Exception ex)
        {
            transaction.Rollback();
            Console.WriteLine("Error occurred.");
        }
    }
}
0

There are 0 answers