example how to inject entity manager