-
Notifications
You must be signed in to change notification settings - Fork 927
/
Copy pathAssemblyRegistration.cs
34 lines (32 loc) · 1 KB
/
AssemblyRegistration.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
/*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
using React.TinyIoC;
namespace React.AspNet
{
/// <summary>
/// Handles registration of ReactJS.NET components that are only applicable
/// in the context of an ASP.NET web application.
/// </summary>
public class AssemblyRegistration : IAssemblyRegistration
{
/// <summary>
/// Registers components in the React IoC container
/// </summary>
/// <param name="container">Container to register components in</param>
public void Register(TinyIoCContainer container)
{
container.Register<IFileSystem, AspNetFileSystem>().AsSingleton();
#if NET451
container.Register<ICache, MemoryFileCache>().AsSingleton();
#else
container.Register<ICache, MemoryFileCacheCore>().AsSingleton();
#endif
}
}
}