I've created service stack angularjs vs template application. Initally I have
? X.AngularJS
? X.AngularJS.ServiceInterface
? X.AngularJS.ServiceModel
? X.AngularJS.Tests
I'm using RavenDb
as datastore.
On X.AngularJS
there is AppHost.cs
configuration object where I'm defining DocumentStore
and access to database.
public override void Configure(Container container)
{
var store = new DocumentStore()
{
Url = "http://...",
DefaultDatabase = "somedb"
}.Initialize();
...
}
Now, if I create Service instance (MySimpleService.cs) inside this project (X.AngularJS
) everything is ok, I have access to
IDocumentSession which I will use to retrieve data.
However this approach is not recommended (at least from my point of view), why would then be a X.AngularJS.ServiceModel
project. I also looked at http://razor.servicestack.net/
where service is embedded in single project together with AppHost.cs
.
So, I would follow this 4 project template (created out of box from vs service stack angularjs template).
Having that in mind can you suggest me how to use (in most basic example) X.AngularJS.ServiceModel
and X.AngularJS
with ravendb database.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…