

insightly-api
@ 15
insightly-api / trunk / Insightly / ICModule / ApiModule.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
using Ninject.Modules; using TS.Insightly.API.Controller; using TS.Insightly.API.Interface; namespace TS.Insightly.API.ICModule { /// <summary> /// Ninject module for binding the various API controllers. /// </summary> public class ApiModule : NinjectModule { #region Fields private readonly string _apiKey; #endregion Fields; /// <summary> /// Initializes a new instance of the <see cref="ApiModule"/> class. /// </summary> /// <param name="apiKey">The API key.</param> public ApiModule(string apiKey) { _apiKey = apiKey; } /// <summary> /// Loads the module into the kernel. /// </summary> public override void Load() { Bind<IContactController>().To<ContactController>().WithConstructorArgument("apiKey", _apiKey); Bind<IOrganisationController>().To<OrganisationController>().WithConstructorArgument("apiKey", _apiKey); Bind<IProjectController>().To<ProjectController>().WithConstructorArgument("apiKey", _apiKey); } } } |
Commits for insightly-api/trunk/Insightly/ICModule/ApiModule.cs
Revision | Author | Commited | Message |
---|---|---|---|
15 |
|
Tue 01 Oct, 2013 13:47:15 +0000 | Refactored, added Ninject to load controllers for each part of the API. |