# is there a difference between E[e|x]=0 and E[e|d=1]-E[e|d=0] in continuous vs discrete case in regressions?

in the discrete case, if assignment is random, then i can express E[y|d=1]-E[y|d=0] = B + E[e|d=1]-E[e|d=0], where the expectation of the errors are the same for both groups and become zero. Where I am confused is for a linear regression/continuous variable, we say this condition is expressed by E[e|x]=0, and I struggle to see how they are the same. its not the same as saying E[e|d]=0 if in the discrete case, right?

If I take a partial derivative of E[y|x] wrt x, I get B+ dE[e|x]/dx. cant I have this last term be zero without having E[e|x]=0? is E[e|x1,x2]=E[e|x2] the same thing as E[e|x]=0?