I am new to dependency injection frameworks. In the following code when I try to make the Child object as singleton, it gives errors and does not compile (see code below).