Skip to content

Commit 3eaf23a

Browse files
committed
Reference OrmLite.Sqlite via NuGet
1 parent b99e848 commit 3eaf23a

35 files changed

+1887
-164
lines changed
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
BODY
2+
{
3+
background: #fff url(../Images/bg-body-1024.png) repeat-y top left;
4+
font: normal normal normal 13.34px/normal helvetica, arial, freesans, clean, sans-serif;
5+
padding: 0 5px 20px 10px;
6+
width: 940px;
7+
}
8+
A IMG
9+
{
10+
border: none;
11+
}
12+
#header-links
13+
{
14+
top: 10px;
15+
left:270px;
16+
position: absolute;
17+
}
18+
#header-links A, #footer-links A
19+
{
20+
color: #0000FF;
21+
margin-left: 0.5em;
22+
}
23+
code
24+
{
25+
background-color: ghostWhite !important;
26+
border: 1px solid #DEDEDE !important;
27+
color: #444 !important;
28+
font-size: 12px !important;
29+
line-height: 1.5em !important;
30+
margin: 1em 0px !important;
31+
overflow: auto !important;
32+
padding: 0.5em !important;
33+
display: block;
34+
font-family: monospace;
35+
margin: 1em 0px;
36+
white-space: pre;
37+
}
38+
H1
39+
{
40+
font-size: 170% !important;
41+
margin-top: 0.65em;
42+
padding-top: 0.5em;
43+
}
44+
H2
45+
{
46+
border-top: 4px solid #E0E0E0 !important;
47+
font-size: 150% !important;
48+
margin-top: 1.5em !important;
49+
padding-top: 0.5em !important;
50+
}
51+
INPUT[type=text]
52+
{
53+
width: 400px;
54+
padding: 2px 5px;
55+
}
56+
.lnk-src
57+
{
58+
padding: 26px 17px 0 0;
59+
float: right;
60+
}
61+
.ib
62+
{
63+
position: relative;
64+
display: -moz-inline-box;
65+
display: inline-block;
66+
}
67+
* html .ib
68+
{
69+
display: inline;
70+
}
71+
*:first-child + html .ib
72+
{
73+
display: inline;
74+
}
75+
H1 A
76+
{
77+
background: url(http://www.servicestack.net/logo-servicestack.png) no-repeat;
78+
display: block;
79+
height: 40px;
80+
padding: 70px 30px 0 120px;
81+
color: #051;
82+
margin: 0 50px 20px 0;
83+
text-decoration: none;
84+
}
85+
#summary
86+
{
87+
margin: 0 0 20px 0;
88+
padding: 10px;
89+
background: #ffc;
90+
color: green;
91+
font-size: 16px;
92+
border: solid 1px #ccc;
93+
font-weight: bold;
94+
text-align: center;
95+
}
96+
#summary A
97+
{
98+
color: blue;
99+
}
100+
#summary B
101+
{
102+
}
103+
104+
#btnReset
105+
{
106+
float: right;
107+
margin: 20px 0 0 0;
108+
}
109+
DT
110+
{
111+
margin: 10px 0 5px 0;
112+
}
113+
#existing-movies DD LABEL
114+
{
115+
width: 300px;
116+
}
117+
.lnk-update, .lnk-delete
118+
{
119+
margin-left: 10px;
120+
color: Blue;
121+
text-decoration: underline;
122+
cursor: pointer;
123+
}
124+
125+
H4
126+
{
127+
position: absolute;
128+
top: 270px;
129+
left: 580px;
130+
}
131+
#restlog
132+
{
133+
position: absolute;
134+
top: 290px;
135+
left: 580px;
136+
width: 360px;
137+
height: 600px;
138+
overflow-y:scroll;
139+
font-size: 14px !important;
140+
line-height: 18px !important;
141+
}
142+
#restlog B
143+
{
144+
width: 70px;
145+
}
146+
147+
FORM
148+
{
149+
display: none;
150+
}
151+
152+
SELECT[name=genres]
153+
{
154+
padding: 4px;
155+
position:absolute;
156+
left: 345px;
157+
margin-top: 20px;
158+
}
159+
160+
#btn-download {
161+
display:block;
162+
border-top: solid 4px #E0E0E0;
163+
margin: 20px 0 20px 0px;
164+
padding: 10px 0 0 0;
165+
}
166+
167+
#csvformat
168+
{
169+
background: url(http://www.servicestack.net/excel16x16.gif) no-repeat top left;
170+
padding: 0 0 0 20px;
171+
margin: 15px 0 0 0;
172+
}
173+
#csvformat B
174+
{
175+
color: Blue;
176+
text-decoration: underline;
177+
cursor: pointer;
178+
}
Loading
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="ServiceStack.MovieRest.Global" Language="C#" %>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using System;
2+
using Funq;
3+
using ServiceStack.Common.Utils;
4+
using ServiceStack.OrmLite;
5+
using ServiceStack.OrmLite.Sqlite;
6+
using ServiceStack.ServiceInterface.Cors;
7+
using ServiceStack.Text;
8+
using ServiceStack.WebHost.Endpoints;
9+
10+
namespace ServiceStack.MovieRest
11+
{
12+
/// <summary>
13+
/// Create your ServiceStack web service application with a singleton AppHost.
14+
/// </summary>
15+
public class MovieAppHost : AppHostBase
16+
{
17+
/// <summary>
18+
/// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services.
19+
/// </summary>
20+
public MovieAppHost() : base("ServiceStack REST at the Movies!", typeof(MovieService).Assembly) { }
21+
22+
/// <summary>
23+
/// Configure the container with the necessary routes for your ServiceStack application.
24+
/// </summary>
25+
/// <param name="container">The built-in IoC used with ServiceStack.</param>
26+
public override void Configure(Container container)
27+
{
28+
//JsConfig.DateHandler = JsonDateHandler.ISO8601;
29+
30+
container.Register<IDbConnectionFactory>(c =>
31+
new OrmLiteConnectionFactory(
32+
"~/App_Data/db.sqlite".MapHostAbsolutePath(),
33+
SqliteOrmLiteDialectProvider.Instance));
34+
35+
//Call existing service
36+
using (var resetMovies = container.Resolve<ResetMoviesService>())
37+
{
38+
resetMovies.Any(null);
39+
}
40+
41+
Routes
42+
.Add<Movie>("/movies")
43+
.Add<Movie>("/movies/{Id}")
44+
.Add<Movies>("/movies")
45+
.Add<Movies>("/movies/genres/{Genre}");
46+
47+
Plugins.Add(new CorsFeature()); //Enable CORS
48+
49+
SetConfig(new EndpointHostConfig {
50+
//DebugMode = true, //Show StackTraces for easier debugging (default auto inferred by Debug/Release builds)
51+
});
52+
}
53+
}
54+
55+
public class Global : System.Web.HttpApplication
56+
{
57+
protected void Application_Start(object sender, EventArgs e)
58+
{
59+
//Initialize your application
60+
(new MovieAppHost()).Init();
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)