ServiceModule.cs 911 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using Autofac;
  6. using System.Reflection;
  7. using Autofac.Core;
  8. using EMIS.DataLogic;
  9. using EMIS.Utility;
  10. using Bowin.Common.XML;
  11. using System.Xml.Linq;
  12. using EMIS.CommonLogic.SystemServices;
  13. using System.Configuration;
  14. using EMIS.ViewModel;
  15. namespace EMIS.CommonLogic
  16. {
  17. public class ServiceModule : Autofac.Module
  18. {
  19. protected override void Load(ContainerBuilder builder)
  20. {
  21. var blAssembly = typeof(BaseServices).Assembly;
  22. builder.RegisterAssemblyTypes(blAssembly)
  23. .Where(x => x.FullName.StartsWith("EMIS.CommonLogic") &&
  24. x.Name != "BaseServices" &&
  25. x.Name.EndsWith("Services"))
  26. .AsImplementedInterfaces()
  27. .PropertiesAutowired()
  28. .InstancePerLifetimeScope();
  29. }
  30. }
  31. }