-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bootstrap.cs
43 lines (37 loc) · 1.58 KB
/
Bootstrap.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
38
39
40
41
42
43
using Nancy;
using SampleNancyProject.Model;
using SampleNancyProject.Persistence;
using Raven.Client;
using Raven.Client.Document;
namespace SampleNancyProject
{
public class Bootstrap : DefaultNancyBootstrapper
{
private IDocumentStore CreateDocumentStore()
{
var documentStore = new DocumentStore { ConnectionStringName = "RAVENDB" };
documentStore.Initialize();
return documentStore;
}
protected override void ConfigureApplicationContainer(TinyIoC.TinyIoCContainer container)
{
var documentStore = CreateDocumentStore();
container.Register(documentStore);
container.Register<IRavenRepository<UserModel>>(new RavenRepository<UserModel>(documentStore));
}
//Example code to override the default nancy directories for content. The default location
// for all your css, images, etc is inside the Content folder.
/*protected override void ConfigureConventions(NancyConventions nancyConventions)
{
nancyConventions.StaticContentsConventions.Add(
StaticContentConventionBuilder.AddDirectory("css", @"Content\css")
);
nancyConventions.StaticContentsConventions.Add(
StaticContentConventionBuilder.AddDirectory("img", @"Content\img")
);
nancyConventions.StaticContentsConventions.Add(
StaticContentConventionBuilder.AddDirectory("scripts", @"Content\scripts")
);
}*/
}
}