Sorry I don't have any example code. I'm simply trying to find an example of how to use Lamar with a new .Net 6 console application and not finding anything on google.
The application is basically just a task runner app. It takes in a command line argument of a class name. The class will implement an interface with a Run() method so that the console app can try to find the class registration in the container and then call the .Run() method of the class.
All I'm finding are examples of how to use Lamar in an ASP.NetCore app which isn't what I'm trying to do, and I'm not sure how I can translate it... if I even can.
So there are two approaches to achieve that.
In this scenario, you will have to share the container and use various methods to get objects from the container. I have not tried it but I believe that you can use BuildMethod to get the object with all dependencies.
Simply you can follow this documentation: https://jasperfx.github.io/lamar/guide/ioc/bootstrapping.html#bootstrapping-a-container on how to see tup but Scanner is similar for both scenarios.