1. $a, b$ are real numbers, the set $M=\left\{\frac{b}{a}, 1\right\}, P=$ $\{a, 0\}, f: x \rightarrow x$ represents mapping the element $x$ from set $M$ to set $P$ as $x$. Then the value of $a+b$ is ( ).
(A) -1
(B) 0
(C) 1
(D) $\pm 1$
-1.C.
From the given, we have $M=P$, thus $\frac{b}{a}=0, a=1$, which means $a=1$, $b=0$. Therefore, $a+b=1$.