How is your context set up?
I think the following might work..
in the context
public DbSet<EntityA> EntityAs { get; set; }
public DbSet<EntityAB EntityABs { get; set; }
then in your other code
objContext.EntityAs.Add(EntityA);
objContext.EntityAB.Add(EntityAB);
objContext.SaveChanges();
If that doesn't work I would explore
objContext.local