6. Let set $A=\{-2,0,1\}, B=\{1,2,3,4, 5\}$, and the mapping $f: A \rightarrow B$ such that for any $x \in A$, $x + f(x) + x f(x)$ is an odd number. Then the number of such mappings $f$ is ( ).
(A) 45
(B) 27
(C) 15
(D) 11
6.A.

When $x=-2$, $x+f(x)+x f(x)=-2-f(-2)$ is odd, then $f(-2)$ can take $1,3,5$, which gives 3 possible values;

When $x=0$, $x+f(x)+x f(x)=f(0)$ is odd, then $f(0)$ can take $1,3,5$, which gives 3 possible values;

When $x=1$, $x+f(x)+x f(x)=1+2 f(1)$ is odd, then $f(1)$ can take $1,2,3,4,5$, which gives 5 possible values.
By the multiplication principle, there are $3 \times 3 \times 5=45$ mappings.