PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/ThinkEmailFomatter/IoCModules/ThinkModule.cs

https://bitbucket.org/nicdao/frg-think-emailformatter
C# | 25 lines | 23 code | 2 blank | 0 comment | 0 complexity | 0d7331ed5204afee83792313610b7f10 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using Autofac;
  6. using ThinkEmailFormatter.Controllers;
  7. using ThinkEmailFormatter.Models;
  8. using System.Web.Configuration;
  9. using ThinkEmailFormatter.ThinkOdata;
  10. namespace ThinkEmailFormatter.IoCModules
  11. {
  12. public class ThinkModule: Module
  13. {
  14. protected override void Load(ContainerBuilder builder)
  15. {
  16. string thinkOdataUrl = WebConfigurationManager.AppSettings["ThinkOdata.Url"];
  17. builder
  18. .Register(c => new ThinkHelper(new ThinkModel(new Uri(thinkOdataUrl))))
  19. .As<IThinkHelper>()
  20. .Named<IThinkHelper>("ThinkHelper");
  21. }
  22. }
  23. }