When do the measure-theoretic and elementary definitions of conditional probability/expectation coincide?

$$\int_C P(A|X)(\omega)dP(\omega)=\int_C E(I_A|X)(\omega)dP(\omega)=\int_C I_A(\omega)dP(\omega)=P(A\cap C)$$ for $C$ in the sigma algebra generated by $X$. So, for $C=\{X\in B\}$, $$\frac{\int_{\{X\in B\}} P(A|X)(\omega)dP(\omega)}{P(X\in B)}=P(A\mid X\in B).$$