forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicAppHost.cs
More file actions
44 lines (34 loc) · 1.32 KB
/
BasicAppHost.cs
File metadata and controls
44 lines (34 loc) · 1.32 KB
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
44
using System;
using System.Collections.Generic;
using Funq;
using ServiceStack.ServiceHost;
using ServiceStack.WebHost.Endpoints;
namespace ServiceStack.ServiceInterface.Testing
{
public class BasicAppHost : IAppHost
{
public BasicAppHost()
{
this.Container = new Container();
this.RequestFilters = new List<Action<IHttpRequest, IHttpResponse, object>>();
this.ResponseFilters = new List<Action<IHttpRequest, IHttpResponse, object>>();
this.HtmlProviders = new List<StreamSerializerResolverDelegate>();
this.CatchAllHandlers = new List<HttpHandlerResolverDelegate>();
}
public T TryResolve<T>()
{
return this.Container.TryResolve<T>();
}
public Container Container { get; set; }
public IContentTypeFilter ContentTypeFilters { get; set; }
public List<Action<IHttpRequest, IHttpResponse, object>> RequestFilters { get; set; }
public List<Action<IHttpRequest, IHttpResponse, object>> ResponseFilters { get; set; }
public List<StreamSerializerResolverDelegate> HtmlProviders { get; set; }
public List<HttpHandlerResolverDelegate> CatchAllHandlers { get; set; }
public EndpointHostConfig Config { get; set; }
public void RegisterService(Type serviceType, params string[] atRestPaths)
{
Config.ServiceManager.RegisterService(serviceType);
}
}
}