forked from ServiceStack/ServiceStack.UseCases
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobal.asax.cs
More file actions
41 lines (36 loc) · 1.08 KB
/
Global.asax.cs
File metadata and controls
41 lines (36 loc) · 1.08 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
using System;
using Funq;
using ServiceStack.MiniProfiler;
using ServiceStack.WebHost.Endpoints;
namespace WebApi.ProductsExample
{
//Product is used by both ServiceStack and WebApi Service Examples
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public string Category { get; set; }
public decimal Price { get; set; }
}
public class AppHost : AppHostBase
{
public AppHost() : base("ServiceStack Messages vs WebApi RPC Demo", typeof(AppHost).Assembly) { }
public override void Configure(Container container) { }
}
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
new AppHost().Init();
}
protected void Application_BeginRequest(object src, EventArgs e)
{
if (Request.IsLocal)
Profiler.Start();
}
protected void Application_EndRequest(object src, EventArgs e)
{
Profiler.Stop();
}
}
}