Don't you need the DbSet<TEntity>?
var dbSet = (IDbSet<SomeEntity>)dbContext
.GetType()
.GetProperty(tableName, BindingFlags.Public | BindingFlags.Instance)
.GetValue(dbContext, null);
Now call DbSet<TEntity> methods as you would do it in a regular scenario, since you've a typed DbSet<T>.
A queryable won't help you much because as you've already guessed, it's about querying rather than performing write operations back to the database.
OP said...
I can't use DbSet because I never know the entity, I ve juste the
name of the table. I make an back office for change value of reference
table, an generic interface..
Then, your solution is going with reflection even to add the entities to the DbSet<TEntity>:
object dbSet = dbContext
.GetType()
.GetProperty(tableName, BindingFlags.Public | BindingFlags.Instance)
.GetValue(dbContext, null);
dbSet.GetMethod("Add", BindingFlags.Public | BindingFlags.Instance)
.Invoke(new object[] { someEntityTypedAsObject });
Or you can store the DbSet<TEntity> as a dynamically-typed reference. This way, you can call it without reflection. It's a performance and readability gain:
dynamic dbSet = dbContext
.GetType()
.GetProperty(tableName, BindingFlags.Public | BindingFlags.Instance)
.GetValue(dbContext, null);
dbSet.Add(someEntity);