Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class KernelImplementation
- {
- private IKernel _kernel;
- public IKernel Kernel
- {
- get
- {
- if (_kernel != null)
- return _kernel;
- else
- {
- _kernel = new StandardKernel(new RepositoryModule(),
- new DomainModule(),
- new ServiceModule(),
- new MessageModule());
- return _kernel;
- }
- }
- }
- }
- Bind<IReviewRepository>().To<ReviewRepository>().InCallScope();
- public class Processor : KernelImplementation
- {
- private readonly IReviewPrintMessage _reviewPrintMessage;
- public Processor()
- {
- _reviewPrintMessage = Kernel.Get<IReviewPrintMessage>();
- [...]
- _bus.Subscribe<ReviewPrintContract>("ReviewPrint_Id",
- (reviewPrintContract) => _reviewPrintMessage.ProcessReviewPrint(reviewPrintContract));
- //calling ProcessReviewPrint where I want my repositories to be available
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement