Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using Ninject.Modules;
  2. using Ninject.Web.Common;
  3. using SlateCore.DAL.Interfaces;
  4. using SlateCore.DAL.Repositories;
  5.  
  6.  
  7. namespace SlateCore.BLL.Util
  8. {
  9. /// <summary>
  10. /// The class for introduction of dependencies
  11. /// </summary>
  12. public class ServiceModule : NinjectModule
  13. {
  14. private string connectionString;
  15.  
  16. public ServiceModule(string connection)
  17. {
  18. connectionString = connection;
  19. }
  20.  
  21. /// <summary>
  22. /// The method establishes dependecies.
  23. /// The UnitOfWork use as the object IUnitOfWork
  24. /// </summary>
  25. public override void Load()
  26. {
  27. //Bind<IUnitOfWork>().To<UnitOfWork>().WithConstructorArgument(connectionString);
  28. Bind<IUnitOfWork>().To<UnitOfWork>().InRequestScope().WithConstructorArgument(connectionString);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement