A line integral $ \int_{C} \vec F\cdot d \vec r$ is path independent if $\vec F$ is a conservative field. $\vec F$ is conservative iff the domain of $\vec F$ is simply connected (in $\mathbb{R}^2$ this usually means that $\vec F$ has no poles) and $\nabla \times \vec F = \vec 0$.
It's easy enough to see that the domain of $\vec F$ is simply connected here and a quick calculation shows that $\nabla \times \vec F = (0, 0, 1-1) = \vec 0$, so $\vec F$ is conservative. Hence $\vec F = \nabla \phi$ for some scalar function $\phi$. Hence $x + y = \frac {\partial \phi}{\partial x}$, so $\phi = \frac{x^2}{2} + yx + f(y) $. Differentiating this with respect to y, we find $ \frac {\partial \phi}{\partial y} = x + f'(y)$, comparing this to our original integral, we see that $f'(y) = -y$, so $f(y) = -\frac{y^2}{2}$ and $\phi = \frac{x^2}{2} - \frac{y^2}{2} + yx$.
So $\int_{(0, 0)}^{(1, 2)} (x+y dx) + (x-y)dy = \phi|_{0,0}^{1,2} = \frac{1}{2} - \frac{4}{2} + (2)(1) = \frac{1}{2}$.