Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using cdmdotnet.StateManagement;
10 : using cdmdotnet.StateManagement.Threaded;
11 : using Cqrs.Ninject.Azure.Wcf.Configuration;
12 : using Ninject.Modules;
13 :
14 : namespace Cqrs.Ninject.Azure.WebJobs.Configuration
15 : {
16 : /// <summary>
17 : /// The core <see cref="INinjectModule"/> for use defining base level requirements.
18 : /// </summary>
19 : public class WebJobHostModule : WebHostModule
20 1 : {
21 : /// <summary>
22 : /// Registers the <see cref="IContextItemCollectionFactory"/> required.
23 : /// </summary>
24 1 : protected override void RegisterContextItemCollectionFactory()
25 : {
26 : // We use console state as, even though a webjob runs in an azure website, it's technically loaded via something call the 'WindowsScriptHost', which is not web and IIS based so it's threading model is very different and more console based.
27 : Bind<IContextItemCollectionFactory>()
28 : .To<ThreadedContextItemCollectionFactory>()
29 : .InSingletonScope();
30 : }
31 : }
32 : }
|