Ensuring the right entit is passed as provider in EntityContext