├── .gitignore
├── Chapter1
├── Example1
│ └── index.html
├── Example10
│ └── index.html
├── Example11
│ └── index.html
├── Example12
│ ├── index.html
│ └── player.html
├── Example13
│ ├── index.html
│ └── player.html
├── Example14
│ ├── index.html
│ └── player.html
├── Example15
│ ├── index.html
│ └── player.html
├── Example16
│ └── index.html
├── Example17
│ └── index.html
├── Example18
│ └── index.html
├── Example2
│ └── index.html
├── Example3
│ └── index.html
├── Example4
│ └── index.html
├── Example5
│ └── index.html
├── Example6
│ └── index.html
├── Example7
│ └── index.html
├── Example8
│ └── index.html
└── Example9
│ └── index.html
├── Chapter2
├── Example1
│ ├── Example1.Web.sln
│ └── Example1.Web
│ │ ├── Example1.Web.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── index.html
│ │ └── player.html
├── Example2
│ ├── Example2.Web.sln
│ └── Example2.Web
│ │ ├── Example2.Web.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── index.html
│ │ ├── packages.config
│ │ ├── player.html
│ │ └── scripts
│ │ ├── angular-mocks.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ └── angular.min.js.map
├── Example3
│ ├── Example3.Web.sln
│ └── Example3.Web
│ │ ├── Content
│ │ ├── bootstrap-theme.css
│ │ ├── bootstrap-theme.css.map
│ │ ├── bootstrap-theme.min.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ └── bootstrap.min.css
│ │ ├── Example3.Web.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ │ ├── index.html
│ │ ├── packages.config
│ │ ├── player.html
│ │ └── scripts
│ │ ├── angular-mocks.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ ├── angular.min.js.map
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.9.0.intellisense.js
│ │ ├── jquery-1.9.0.js
│ │ ├── jquery-1.9.0.min.js
│ │ └── jquery-1.9.0.min.map
├── Example4
│ ├── Example4.Web.sln
│ └── Example4.Web
│ │ ├── Content
│ │ ├── bootstrap-theme.css
│ │ ├── bootstrap-theme.css.map
│ │ ├── bootstrap-theme.min.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ └── bootstrap.min.css
│ │ ├── Example4.Web.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ │ ├── index.html
│ │ ├── packages.config
│ │ ├── player.html
│ │ └── scripts
│ │ ├── angular-mocks.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ ├── angular.min.js.map
│ │ ├── app
│ │ ├── app.js
│ │ ├── controllers.js
│ │ ├── directives.js
│ │ └── services.js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.9.0.intellisense.js
│ │ ├── jquery-1.9.0.js
│ │ ├── jquery-1.9.0.min.js
│ │ └── jquery-1.9.0.min.map
├── Example5
│ ├── Example5.Web.sln
│ └── Example5.Web
│ │ ├── Content
│ │ ├── bootstrap-theme.css
│ │ ├── bootstrap-theme.css.map
│ │ ├── bootstrap-theme.min.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ └── bootstrap.min.css
│ │ ├── Example5.Web.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ │ ├── index.html
│ │ ├── packages.config
│ │ └── scripts
│ │ ├── angular-mocks.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ ├── angular.min.js.map
│ │ ├── app
│ │ ├── app.js
│ │ ├── controllers
│ │ │ └── exampleController.js
│ │ ├── directives
│ │ │ └── myPlayer.js
│ │ ├── services
│ │ │ └── playerService.js
│ │ └── views
│ │ │ └── player.html
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.9.0.intellisense.js
│ │ ├── jquery-1.9.0.js
│ │ ├── jquery-1.9.0.min.js
│ │ └── jquery-1.9.0.min.map
├── Example6
│ ├── Example6.Web.sln
│ └── Example6.Web
│ │ ├── Content
│ │ ├── bootstrap-theme.css
│ │ ├── bootstrap-theme.css.map
│ │ ├── bootstrap-theme.min.css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ └── bootstrap.min.css
│ │ ├── Example6.Web.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ │ ├── index.html
│ │ ├── packages.config
│ │ └── scripts
│ │ ├── angular-mocks.js
│ │ ├── angular.js
│ │ ├── angular.min.js
│ │ ├── angular.min.js.map
│ │ ├── app
│ │ ├── app.js
│ │ ├── controllers
│ │ │ └── exampleController.js
│ │ ├── directives
│ │ │ └── myPlayer.js
│ │ ├── services
│ │ │ └── playerService.js
│ │ └── views
│ │ │ └── player.html
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.9.0.intellisense.js
│ │ ├── jquery-1.9.0.js
│ │ ├── jquery-1.9.0.min.js
│ │ └── jquery-1.9.0.min.map
└── Example7
│ ├── Example7.Web.sln
│ └── Example7.Web
│ ├── Content
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ ├── bootstrap-theme.min.css
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ └── bootstrap.min.css
│ ├── Example7.Web.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ ├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
│ ├── index.html
│ ├── packages.config
│ └── scripts
│ ├── angular-mocks.js
│ ├── angular-route.js
│ ├── angular-route.min.js
│ ├── angular-route.min.js.map
│ ├── angular.js
│ ├── angular.min.js
│ ├── angular.min.js.map
│ ├── app
│ ├── app.js
│ ├── controllers
│ │ └── exampleController.js
│ ├── directives
│ │ └── myPlayer.js
│ ├── services
│ │ └── playerService.js
│ └── views
│ │ ├── multiPlayer.html
│ │ ├── player.html
│ │ └── singlePlayer.html
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ ├── jquery-1.9.0.intellisense.js
│ ├── jquery-1.9.0.js
│ ├── jquery-1.9.0.min.js
│ └── jquery-1.9.0.min.map
├── Chapter3
├── Example1
│ ├── Example1.Web
│ │ ├── AppHost.cs
│ │ ├── Example1.Web.csproj
│ │ ├── Global.asax
│ │ ├── Global.asax.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ └── packages.config
│ └── Example1.sln
├── Example2
│ ├── Example2.Console
│ │ ├── App.config
│ │ ├── Example2.Console.csproj
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ ├── Example2.Web
│ │ ├── AppHost.cs
│ │ ├── Example2.Web.csproj
│ │ ├── Global.asax
│ │ ├── Global.asax.cs
│ │ ├── PlayersService.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ └── packages.config
│ └── Example2.sln
├── Example3
│ ├── Example3.Web
│ │ ├── AppHost.cs
│ │ ├── Example3.Web.csproj
│ │ ├── Global.asax
│ │ ├── Global.asax.cs
│ │ ├── PlayersService.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Web.Debug.config
│ │ ├── Web.Release.config
│ │ ├── Web.config
│ │ └── packages.config
│ └── Example3.sln
└── Example4
│ ├── Example4.Web
│ ├── AppHost.cs
│ ├── Example4.Web.csproj
│ ├── GetPlayer.cs
│ ├── GetPlayers.cs
│ ├── Global.asax
│ ├── Global.asax.cs
│ ├── Player.cs
│ ├── PlayerValidator.cs
│ ├── PlayersRepository.cs
│ ├── PlayersService.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ └── packages.config
│ └── Example4.sln
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Dd]ebugPublic/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | bld/
16 | [Bb]in/
17 | [Oo]bj/
18 |
19 | # MSTest test Results
20 | [Tt]est[Rr]esult*/
21 | [Bb]uild[Ll]og.*
22 |
23 | #NUNIT
24 | *.VisualState.xml
25 | TestResult.xml
26 |
27 | # Build Results of an ATL Project
28 | [Dd]ebugPS/
29 | [Rr]eleasePS/
30 | dlldata.c
31 |
32 | *_i.c
33 | *_p.c
34 | *_i.h
35 | *.ilk
36 | *.meta
37 | *.obj
38 | *.pch
39 | *.pdb
40 | *.pgc
41 | *.pgd
42 | *.rsp
43 | *.sbr
44 | *.tlb
45 | *.tli
46 | *.tlh
47 | *.tmp
48 | *.tmp_proj
49 | *.log
50 | *.vspscc
51 | *.vssscc
52 | .builds
53 | *.pidb
54 | *.svclog
55 | *.scc
56 |
57 | # Chutzpah Test files
58 | _Chutzpah*
59 |
60 | # Visual C++ cache files
61 | ipch/
62 | *.aps
63 | *.ncb
64 | *.opensdf
65 | *.sdf
66 | *.cachefile
67 |
68 | # Visual Studio profiler
69 | *.psess
70 | *.vsp
71 | *.vspx
72 |
73 | # TFS 2012 Local Workspace
74 | $tf/
75 |
76 | # Guidance Automation Toolkit
77 | *.gpState
78 |
79 | # ReSharper is a .NET coding add-in
80 | _ReSharper*/
81 | *.[Rr]e[Ss]harper
82 | *.DotSettings.user
83 |
84 | # JustCode is a .NET coding addin-in
85 | .JustCode
86 |
87 | # TeamCity is a build add-in
88 | _TeamCity*
89 |
90 | # DotCover is a Code Coverage Tool
91 | *.dotCover
92 |
93 | # NCrunch
94 | *.ncrunch*
95 | _NCrunch_*
96 | .*crunch*.local.xml
97 |
98 | # MightyMoose
99 | *.mm.*
100 | AutoTest.Net/
101 |
102 | # Web workbench (sass)
103 | .sass-cache/
104 |
105 | # Installshield output folder
106 | [Ee]xpress/
107 |
108 | # DocProject is a documentation generator add-in
109 | DocProject/buildhelp/
110 | DocProject/Help/*.HxT
111 | DocProject/Help/*.HxC
112 | DocProject/Help/*.hhc
113 | DocProject/Help/*.hhk
114 | DocProject/Help/*.hhp
115 | DocProject/Help/Html2
116 | DocProject/Help/html
117 |
118 | # Click-Once directory
119 | publish/
120 |
121 | # Publish Web Output
122 | *.[Pp]ublish.xml
123 | *.azurePubxml
124 |
125 | # NuGet Packages Directory
126 | packages/
127 | ## TODO: If the tool you use requires repositories.config uncomment the next line
128 | #!packages/repositories.config
129 |
130 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
131 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
132 | !packages/build/
133 |
134 | # Windows Azure Build Output
135 | csx/
136 | *.build.csdef
137 |
138 | # Windows Store app package directory
139 | AppPackages/
140 |
141 | # Others
142 | sql/
143 | *.Cache
144 | ClientBin/
145 | [Ss]tyle[Cc]op.*
146 | ~$*
147 | *~
148 | *.dbmdl
149 | *.dbproj.schemaview
150 | *.pfx
151 | *.publishsettings
152 | node_modules/
153 |
154 | # RIA/Silverlight projects
155 | Generated_Code/
156 |
157 | # Backup & report files from converting an old project file to a newer
158 | # Visual Studio version. Backup files are not needed, because we have git ;-)
159 | _UpgradeReport_Files/
160 | Backup*/
161 | UpgradeLog*.XML
162 | UpgradeLog*.htm
163 |
164 | # SQL Server files
165 | *.mdf
166 | *.ldf
167 |
168 | # Business Intelligence projects
169 | *.rdl.data
170 | *.bim.layout
171 | *.bim_*.settings
172 |
173 | # Microsoft Fakes
174 | FakesAssemblies/
175 |
--------------------------------------------------------------------------------
/Chapter1/Example1/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example1
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 |
13 |
14 |
20 | Hello! My name is .
21 |
22 |
23 | My favorite color is .
24 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Chapter1/Example10/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example10
6 |
7 |
8 |
9 | Game setup
10 |
11 |
Player {{$index + 1}}
12 |
13 |
14 | Player {{$index + 1}} name is {{player.name}}.
15 | Previous Player {{$index + 1}} name was {{player.previousName}}.
16 |
17 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Chapter1/Example11/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example11
6 |
7 |
8 |
9 | Game setup
10 |
11 |
Player {{$index + 1}}
12 |
13 |
14 | Player {{$index + 1}} name is {{player.name}}.
15 | Previous Player {{$index + 1}} name was {{player.previousName}}.
16 |
17 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Chapter1/Example12/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example12
6 |
7 |
8 |
9 | Game setup
10 |
11 |
12 |
13 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Chapter1/Example12/player.html:
--------------------------------------------------------------------------------
1 | Player {{playerIndex + 1}}
2 |
3 |
4 | Player {{playerIndex + 1}} name is {{player.name}}.
5 | Previous Player {{playerIndex + 1}} name was {{player.previousName}}.
6 |
--------------------------------------------------------------------------------
/Chapter1/Example13/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example13
6 |
7 |
8 |
9 | Game setup
10 |
11 |
12 |
13 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Chapter1/Example13/player.html:
--------------------------------------------------------------------------------
1 | Player {{player.id}}
2 |
3 |
4 | Player {{player.id}} name is {{player.name}}.
--------------------------------------------------------------------------------
/Chapter1/Example14/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example14
6 |
7 |
8 |
9 | Game setup
10 |
11 |
12 |
13 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Chapter1/Example14/player.html:
--------------------------------------------------------------------------------
1 | Player {{player.id}}
2 |
3 |
4 | Player {{player.id}} name is {{player.name}}.
--------------------------------------------------------------------------------
/Chapter1/Example15/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example15
6 |
7 |
8 |
9 | Game setup
10 |
11 |
12 |
13 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Chapter1/Example15/player.html:
--------------------------------------------------------------------------------
1 | Player {{player.id}}
2 |
3 |
4 | Player {{player.id}} name is {{player.name}}.
--------------------------------------------------------------------------------
/Chapter1/Example16/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example16
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 | Hello! My name is {{name | uppercase}} and today is {{today | date:'EEEE'}}.
13 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Chapter1/Example17/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example17
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 | Hello! My name is {{getNameWithFilter()}} and today is {{today}}.
13 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter1/Example18/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example18
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 | Hello! My name is {{name | customname}}.
13 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Chapter1/Example2/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example2
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 |
13 |
14 |
20 | Hello! My name is {{name}}.
21 | My favourite color is
22 | .
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Chapter1/Example3/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example3
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 |
13 |
14 |
20 | Hello! My name is {{name}}.
21 | My favourite color is
22 | .
23 | The favorite color was changed {{colorChangeCount}} times.
24 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Chapter1/Example4/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example4
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 | Hello! My name is {{name}}.
13 | Previous name was {{previousName}}.
14 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter1/Example5/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example5
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 | Hello! My name is {{name}}.
13 | Previous name was {{previousName}}.
14 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Chapter1/Example6/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example6
6 |
7 |
8 | Revealing module pattern
9 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter1/Example7/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example7
6 |
7 |
8 |
9 | Introduction
10 |
11 |
12 | Hello! My name is {{name}}.
13 | Previous name was {{previousName}}.
14 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Chapter1/Example8/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example8
6 |
7 |
8 |
9 | Game setup
10 |
11 |
Player 1
12 |
13 |
14 | Player 1 name is {{name}}.
15 | Previous Player 1 name was {{previousName}}.
16 |
17 |
18 |
Player 2
19 |
20 |
21 | Player 2 name is {{name}}.
22 | Previous Player 2 name was {{previousName}}.
23 |
24 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Chapter1/Example9/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter1 Example9
6 |
7 |
8 |
9 | Game setup
10 |
11 |
Player 1
12 |
13 |
14 | Player 1 name is {{player.name}}.
15 | Previous Player 1 name was {{player.previousName}}.
16 |
17 |
18 |
Player 2
19 |
20 |
21 | Player 2 name is {{player.name}}.
22 | Previous Player 2 name was {{player.previousName}}.
23 | Player count across all service instances is {{playerCount}}.
24 |
25 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example1.Web", "Example1.Web\Example1.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/Example1.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example1.Web
15 | Example1.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | Web.config
62 |
63 |
64 | Web.config
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | 10.0
77 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | True
87 | True
88 | 61803
89 | /
90 | http://localhost:61803/
91 | False
92 | False
93 |
94 |
95 | False
96 |
97 |
98 |
99 |
100 |
107 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example1
6 |
7 |
8 |
9 | Game setup
10 |
11 |
12 |
13 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Chapter2/Example1/Example1.Web/player.html:
--------------------------------------------------------------------------------
1 | Player {{player.id}}
2 |
3 |
4 | Player {{player.id}} name is {{player.name}}.
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example2.Web", "Example2.Web\Example2.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/Example2.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example2.Web
15 | Example2.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | Web.config
66 |
67 |
68 | Web.config
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | 10.0
82 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | True
92 | True
93 | 61803
94 | /
95 | http://localhost:61803/
96 | False
97 | False
98 |
99 |
100 | False
101 |
102 |
103 |
104 |
105 |
112 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example2
6 |
7 |
8 |
9 | Game setup
10 |
11 |
12 |
13 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter2/Example2/Example2.Web/player.html:
--------------------------------------------------------------------------------
1 | Player {{player.id}}
2 |
3 |
4 | Player {{player.id}} name is {{player.name}}.
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.Web", "Example3.Web\Example3.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/Example3.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example2.Web
15 | Example2.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | Web.config
82 |
83 |
84 | Web.config
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 | 10.0
98 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | True
108 | True
109 | 61803
110 | /
111 | http://localhost:61803/
112 | False
113 | False
114 |
115 |
116 | False
117 |
118 |
119 |
120 |
121 |
128 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example3/Example3.Web/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example3/Example3.Web/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example3/Example3.Web/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example3
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Game setup
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter2/Example3/Example3.Web/player.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Player {{player.id}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Player {{player.id}} name is {{player.name}}.
17 |
18 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example4.Web", "Example4.Web\Example4.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/Example4.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example2.Web
15 | Example2.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | Web.config
86 |
87 |
88 | Web.config
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | 10.0
102 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | True
112 | True
113 | 61803
114 | /
115 | http://localhost:61803/
116 | False
117 | False
118 |
119 |
120 | False
121 |
122 |
123 |
124 |
125 |
132 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example4/Example4.Web/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example4/Example4.Web/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example4/Example4.Web/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example4
6 |
7 |
8 |
9 |
10 |
11 |
12 |
Game setup
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/player.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Player {{player.id}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Player {{player.id}} name is {{player.name}}.
17 |
18 |
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/scripts/app/app.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp', []);
5 | })();
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/scripts/app/controllers.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.controller('ExampleController', ['$scope', 'playerService',
7 | function ($scope, playerService) {
8 | $scope.players = [playerService.createPlayer(), playerService.createPlayer()];
9 | }
10 | ]);
11 | })();
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/scripts/app/directives.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.directive('myPlayer', function () {
7 | return {
8 | restrict: 'E',
9 | templateUrl: 'player.html',
10 | scope: {
11 | player: "="
12 | }
13 | };
14 | });
15 | })();
--------------------------------------------------------------------------------
/Chapter2/Example4/Example4.Web/scripts/app/services.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.factory('playerService', function () {
7 | var playerIndex = 0;
8 | return {
9 | createPlayer: function () {
10 | playerIndex += 1;
11 | return {
12 | id: playerIndex,
13 | name: "Player" + playerIndex
14 | };
15 | }
16 | };
17 | });
18 | })();
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example5.Web", "Example5.Web\Example5.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/Example5.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example2.Web
15 | Example2.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | Web.config
86 |
87 |
88 | Web.config
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | 10.0
102 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | True
112 | True
113 | 61803
114 | /
115 | http://localhost:61803/
116 | False
117 | False
118 |
119 |
120 | False
121 |
122 |
123 |
124 |
125 |
132 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example5/Example5.Web/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example5/Example5.Web/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example5/Example5.Web/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example5
6 |
7 |
8 |
9 |
10 |
11 |
12 |
Game setup
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/scripts/app/app.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp', []);
5 | })();
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/scripts/app/controllers/exampleController.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.controller('ExampleController', ['$scope', 'playerService',
7 | function ($scope, playerService) {
8 | $scope.players = [playerService.createPlayer(), playerService.createPlayer()];
9 | }
10 | ]);
11 | })();
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/scripts/app/directives/myPlayer.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.directive('myPlayer', function () {
7 | return {
8 | restrict: 'E',
9 | templateUrl: 'scripts/app/views/player.html',
10 | scope: {
11 | player: "="
12 | }
13 | };
14 | });
15 | })();
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/scripts/app/services/playerService.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.factory('playerService', function () {
7 | var playerIndex = 0;
8 | return {
9 | createPlayer: function () {
10 | playerIndex += 1;
11 | return {
12 | id: playerIndex,
13 | name: "Player" + playerIndex
14 | };
15 | }
16 | };
17 | });
18 | })();
--------------------------------------------------------------------------------
/Chapter2/Example5/Example5.Web/scripts/app/views/player.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Player {{player.id}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Player {{player.id}} name is {{player.name}}.
17 |
18 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6.Web", "Example6.Web\Example6.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/Example6.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example2.Web
15 | Example2.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | Web.config
86 |
87 |
88 | Web.config
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | 10.0
102 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | True
112 | True
113 | 61803
114 | /
115 | http://localhost:61803/
116 | False
117 | False
118 |
119 |
120 | False
121 |
122 |
123 |
124 |
125 |
132 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example6/Example6.Web/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example6/Example6.Web/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example6/Example6.Web/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example6
6 |
7 |
8 |
9 |
10 |
11 |
12 |
Game setup
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 | Creating players ...
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/scripts/app/app.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp', []);
5 | })();
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/scripts/app/controllers/exampleController.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.controller('ExampleController', ['$scope', '$timeout', 'playerService',
7 | function ($scope, $timeout, playerService) {
8 | $scope.reset = function () {
9 | $scope.players = null;
10 | playerService.resetPlayerCount();
11 | }
12 |
13 | $scope.callwindowsetTimeout = function () {
14 | $scope.players = [];
15 | window.setTimeout(function () {
16 | $scope.players = [playerService.createPlayer(), playerService.createPlayer()];
17 | playerService.resetPlayerCount();
18 | console.log($scope.players.length.toString() + " players were created.");
19 | }, 2000);
20 | };
21 |
22 | $scope.call$timeout = function () {
23 | $scope.players = [];
24 | $timeout(function () {
25 | $scope.players = [playerService.createPlayer(), playerService.createPlayer()];
26 | playerService.resetPlayerCount();
27 | }, 2000);
28 | };
29 |
30 | $scope.callwindowsetTimeoutWithin$scope$apply = function () {
31 | $scope.players = [];
32 | window.setTimeout(function () {
33 | $scope.$apply(function () {
34 | $scope.players = [playerService.createPlayer(), playerService.createPlayer()];
35 | playerService.resetPlayerCount();
36 | });
37 | }, 2000);
38 | };
39 | }
40 | ]);
41 | })();
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/scripts/app/directives/myPlayer.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.directive('myPlayer', function () {
7 | return {
8 | restrict: 'E',
9 | templateUrl: 'scripts/app/views/player.html',
10 | scope: {
11 | player: "="
12 | }
13 | };
14 | });
15 | })();
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/scripts/app/services/playerService.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var myAppModule = angular.module('myApp');
5 |
6 | myAppModule.factory('playerService', function () {
7 | var playerIndex = 0;
8 | return {
9 | createPlayer: function () {
10 | playerIndex += 1;
11 | return {
12 | id: playerIndex,
13 | name: "Player" + playerIndex
14 | };
15 | },
16 | resetPlayerCount: function() {
17 | playerIndex = 0;
18 | }
19 | };
20 | });
21 | })();
--------------------------------------------------------------------------------
/Chapter2/Example6/Example6.Web/scripts/app/views/player.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Player {{player.id}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Player {{player.id}} name is {{player.name}}.
17 |
18 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example7.Web", "Example7.Web\Example7.Web.csproj", "{4E82E4E0-4683-438B-9C85-5AFD36484F90}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E82E4E0-4683-438B-9C85-5AFD36484F90}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("df4e2028-772b-409c-9a06-6a41027e857b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example7/Example7.Web/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example7/Example7.Web/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alexpopdev/angularjs-dotnet-book/9f9459a8e095e9efc73a502eab10423e3db635ce/Chapter2/Example7/Example7.Web/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter2 Example7
6 |
7 |
8 |
9 |
10 |
11 |
12 |
Game setup
13 |
14 |
15 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/scripts/angular-route.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.2.15
3 | (c) 2010-2014 Google, Inc. http://angularjs.org
4 | License: MIT
5 | */
6 | (function(n,e,A){'use strict';function x(s,g,k){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,w){function y(){p&&(p.remove(),p=null);h&&(h.$destroy(),h=null);l&&(k.leave(l,function(){p=null}),p=l,l=null)}function v(){var b=s.current&&s.current.locals;if(e.isDefined(b&&b.$template)){var b=a.$new(),d=s.current;l=w(b,function(d){k.enter(d,null,l||c,function(){!e.isDefined(t)||t&&!a.$eval(t)||g()});y()});h=d.scope=b;h.$emit("$viewContentLoaded");h.$eval(u)}else y()}
7 | var h,l,p,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",v);v()}}}function z(e,g,k){return{restrict:"ECA",priority:-400,link:function(a,c){var b=k.current,f=b.locals;c.html(f.$template);var w=e(c.contents());b.controller&&(f.$scope=a,f=g(b.controller,f),b.controllerAs&&(a[b.controllerAs]=f),c.data("$ngControllerController",f),c.children().data("$ngControllerController",f));w(a)}}}n=e.module("ngRoute",["ng"]).provider("$route",function(){function s(a,c){return e.extend(new (e.extend(function(){},
8 | {prototype:a})),c)}function g(a,e){var b=e.caseInsensitiveMatch,f={originalPath:a,regexp:a},k=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,e,b,c){a="?"===c?c:null;c="*"===c?c:null;k.push({name:b,optional:!!a});e=e||"";return""+(a?"":e)+"(?:"+(a?e:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=RegExp("^"+a+"$",b?"i":"");return f}var k={};this.when=function(a,c){k[a]=e.extend({reloadOnSearch:!0},c,a&&g(a,c));if(a){var b=
9 | "/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";k[b]=e.extend({redirectTo:a},g(b,c))}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,c,b,f,g,n,v,h){function l(){var d=p(),m=r.current;if(d&&m&&d.$$route===m.$$route&&e.equals(d.pathParams,m.pathParams)&&!d.reloadOnSearch&&!u)m.params=d.params,e.copy(m.params,b),a.$broadcast("$routeUpdate",m);else if(d||m)u=!1,a.$broadcast("$routeChangeStart",
10 | d,m),(r.current=d)&&d.redirectTo&&(e.isString(d.redirectTo)?c.path(t(d.redirectTo,d.params)).search(d.params).replace():c.url(d.redirectTo(d.pathParams,c.path(),c.search())).replace()),f.when(d).then(function(){if(d){var a=e.extend({},d.resolve),c,b;e.forEach(a,function(d,c){a[c]=e.isString(d)?g.get(d):g.invoke(d)});e.isDefined(c=d.template)?e.isFunction(c)&&(c=c(d.params)):e.isDefined(b=d.templateUrl)&&(e.isFunction(b)&&(b=b(d.params)),b=h.getTrustedResourceUrl(b),e.isDefined(b)&&(d.loadedTemplateUrl=
11 | b,c=n.get(b,{cache:v}).then(function(a){return a.data})));e.isDefined(c)&&(a.$template=c);return f.all(a)}}).then(function(c){d==r.current&&(d&&(d.locals=c,e.copy(d.params,b)),a.$broadcast("$routeChangeSuccess",d,m))},function(c){d==r.current&&a.$broadcast("$routeChangeError",d,m,c)})}function p(){var a,b;e.forEach(k,function(f,k){var q;if(q=!b){var g=c.path();q=f.keys;var l={};if(f.regexp)if(g=f.regexp.exec(g)){for(var h=1,p=g.length;h
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/scripts/app/views/player.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Player {{player.id}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Player {{player.id}} name is {{player.name}}.
17 |
18 |
--------------------------------------------------------------------------------
/Chapter2/Example7/Example7.Web/scripts/app/views/singlePlayer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/AppHost.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.WebHost.Endpoints;
2 |
3 | namespace Example1.Web
4 | {
5 | public class AppHost : AppHostBase
6 | {
7 | public AppHost()
8 | : base("Chapter3 Example1", typeof (AppHost).Assembly)
9 | {
10 | }
11 |
12 | public override void Configure(Funq.Container container)
13 | {
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Example1.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {E1675FF2-D428-4FD7-84E8-C968B552459B}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example1.Web
15 | Example1.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 | ..\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll
44 |
45 |
46 | ..\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Common.dll
47 |
48 |
49 | ..\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Interfaces.dll
50 |
51 |
52 | ..\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.dll
53 |
54 |
55 | ..\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.SqlServer.dll
56 |
57 |
58 | ..\packages\ServiceStack.Redis.3.9.71\lib\net35\ServiceStack.Redis.dll
59 |
60 |
61 | ..\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.ServiceInterface.dll
62 |
63 |
64 | ..\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Web.config
87 |
88 |
89 | Web.config
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | Global.asax
100 |
101 |
102 |
103 |
104 | 10.0
105 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | True
115 | True
116 | 54395
117 | /
118 | http://localhost:54114/
119 | False
120 | False
121 |
122 |
123 | False
124 |
125 |
126 |
127 |
128 |
135 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Example1.Web.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Example1.Web
4 | {
5 | public class Global : System.Web.HttpApplication
6 | {
7 |
8 | protected void Application_Start(object sender, EventArgs e)
9 | {
10 | new AppHost().Init();
11 | }
12 |
13 | protected void Session_Start(object sender, EventArgs e)
14 | {
15 |
16 | }
17 |
18 | protected void Application_BeginRequest(object sender, EventArgs e)
19 | {
20 |
21 | }
22 |
23 | protected void Application_AuthenticateRequest(object sender, EventArgs e)
24 | {
25 |
26 | }
27 |
28 | protected void Application_Error(object sender, EventArgs e)
29 | {
30 |
31 | }
32 |
33 | protected void Session_End(object sender, EventArgs e)
34 | {
35 |
36 | }
37 |
38 | protected void Application_End(object sender, EventArgs e)
39 | {
40 |
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example1")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example1")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("25adcb82-84ad-49f2-9fa9-48fbdebfd5e7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter3/Example1/Example1.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example1.Web", "Example1.Web\Example1.Web.csproj", "{E1675FF2-D428-4FD7-84E8-C968B552459B}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Console/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Console/Example2.Console.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {858D28AC-7BF7-40B6-A5E1-65EF5F32E774}
8 | Exe
9 | Properties
10 | Example2.Console
11 | Example2.Console
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Common.dll
37 |
38 |
39 | ..\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Interfaces.dll
40 |
41 |
42 | ..\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | {e1675ff2-d428-4fd7-84e8-c968b552459b}
63 | Example2.Web
64 |
65 |
66 |
67 |
74 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Console/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Example2.Web;
3 | using ServiceStack.ServiceClient.Web;
4 |
5 | namespace Example2.Console
6 | {
7 | class Program
8 | {
9 | static void Main(string[] args)
10 | {
11 | var client = new JsonServiceClient("http://localhost:54114/");
12 | List players = client.Get(new GetPlayers());
13 | players.ForEach(player => System.Console.WriteLine("Player {0} details: first name - {1}, last name - {2}", player.Id, player.FirstName, player.LastName));
14 | System.Console.WriteLine("Press any key to continue ...");
15 | System.Console.ReadLine();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Console/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example2.Console")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example2.Console")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("a4f3f614-ccc3-48bd-ac9d-e6c0762a947a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Console/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/AppHost.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.WebHost.Endpoints;
2 |
3 | namespace Example2.Web
4 | {
5 | public class AppHost : AppHostBase
6 | {
7 | public AppHost()
8 | : base("Chapter3 Example2", typeof (AppHost).Assembly)
9 | {
10 | }
11 |
12 | public override void Configure(Funq.Container container)
13 | {
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Example2.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {E1675FF2-D428-4FD7-84E8-C968B552459B}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Example2.Web
15 | Example2.Web
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\
36 | TRACE
37 | prompt
38 | 4
39 |
40 |
41 |
42 |
43 | ..\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll
44 |
45 |
46 | ..\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Common.dll
47 |
48 |
49 | ..\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Interfaces.dll
50 |
51 |
52 | ..\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.dll
53 |
54 |
55 | ..\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.SqlServer.dll
56 |
57 |
58 | ..\packages\ServiceStack.Redis.3.9.71\lib\net35\ServiceStack.Redis.dll
59 |
60 |
61 | ..\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.ServiceInterface.dll
62 |
63 |
64 | ..\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Web.config
87 |
88 |
89 | Web.config
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | Global.asax
100 |
101 |
102 |
103 |
104 |
105 | 10.0
106 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | True
116 | True
117 | 54395
118 | /
119 | http://localhost:54114/
120 | False
121 | False
122 |
123 |
124 | False
125 |
126 |
127 |
128 |
129 |
136 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Example2.Web.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Example2.Web
4 | {
5 | public class Global : System.Web.HttpApplication
6 | {
7 |
8 | protected void Application_Start(object sender, EventArgs e)
9 | {
10 | new AppHost().Init();
11 | }
12 |
13 | protected void Session_Start(object sender, EventArgs e)
14 | {
15 |
16 | }
17 |
18 | protected void Application_BeginRequest(object sender, EventArgs e)
19 | {
20 |
21 | }
22 |
23 | protected void Application_AuthenticateRequest(object sender, EventArgs e)
24 | {
25 |
26 | }
27 |
28 | protected void Application_Error(object sender, EventArgs e)
29 | {
30 |
31 | }
32 |
33 | protected void Session_End(object sender, EventArgs e)
34 | {
35 |
36 | }
37 |
38 | protected void Application_End(object sender, EventArgs e)
39 | {
40 |
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/PlayersService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using ServiceStack.ServiceHost;
4 |
5 | namespace Example2.Web
6 | {
7 | public class PlayersService : IService
8 | {
9 | public List Get(GetPlayers request)
10 | {
11 | return GetPlayers();
12 | }
13 |
14 | public Player Get(GetPlayer request)
15 | {
16 | return GetPlayers().Single(p => p.Id == request.Id);
17 | }
18 |
19 | private List GetPlayers()
20 | {
21 | return new List
22 | {
23 | new Player{ Id= 1, FirstName="Angela", LastName = "Evans"},
24 | new Player{ Id= 2, FirstName="Jack", LastName = "Marshall"},
25 | };
26 | }
27 | }
28 |
29 | [Route("/players", "GET")]
30 | public class GetPlayers : IReturn>
31 | {
32 | }
33 |
34 | [Route("/players/{Id}", "GET")]
35 | public class GetPlayer : IReturn
36 | {
37 | public int Id { get; set; }
38 | }
39 |
40 | public class Player
41 | {
42 | public int Id { get; set; }
43 |
44 | public string FirstName { get; set; }
45 |
46 | public string LastName { get; set; }
47 | }
48 | }
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example2")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example2")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("25adcb82-84ad-49f2-9fa9-48fbdebfd5e7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter3/Example2/Example2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example2.Web", "Example2.Web\Example2.Web.csproj", "{E1675FF2-D428-4FD7-84E8-C968B552459B}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example2.Console", "Example2.Console\Example2.Console.csproj", "{858D28AC-7BF7-40B6-A5E1-65EF5F32E774}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {858D28AC-7BF7-40B6-A5E1-65EF5F32E774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {858D28AC-7BF7-40B6-A5E1-65EF5F32E774}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {858D28AC-7BF7-40B6-A5E1-65EF5F32E774}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {858D28AC-7BF7-40B6-A5E1-65EF5F32E774}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/AppHost.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ServiceStack.WebHost.Endpoints;
3 |
4 | namespace Example3.Web
5 | {
6 | public class AppHost : AppHostBase
7 | {
8 | public AppHost()
9 | : base("Chapter3 Example3", typeof (AppHost).Assembly)
10 | {
11 | }
12 |
13 | public override void Configure(Funq.Container container)
14 | {
15 | RequestFilters.Add((request, response, requestDTO) =>
16 | {
17 | if(!request.IsSecureConnection)
18 | {
19 | throw new Exception("The application needs to be secured. Use https instead of http for hosting!");
20 | }
21 | });
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Example3.Web.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Example3.Web
4 | {
5 | public class Global : System.Web.HttpApplication
6 | {
7 |
8 | protected void Application_Start(object sender, EventArgs e)
9 | {
10 | new AppHost().Init();
11 | }
12 |
13 | protected void Session_Start(object sender, EventArgs e)
14 | {
15 |
16 | }
17 |
18 | protected void Application_BeginRequest(object sender, EventArgs e)
19 | {
20 |
21 | }
22 |
23 | protected void Application_AuthenticateRequest(object sender, EventArgs e)
24 | {
25 |
26 | }
27 |
28 | protected void Application_Error(object sender, EventArgs e)
29 | {
30 |
31 | }
32 |
33 | protected void Session_End(object sender, EventArgs e)
34 | {
35 |
36 | }
37 |
38 | protected void Application_End(object sender, EventArgs e)
39 | {
40 |
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/PlayersService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using ServiceStack.ServiceHost;
4 |
5 | namespace Example3.Web
6 | {
7 | public class PlayersService : IService
8 | {
9 | public List Get(GetPlayers request)
10 | {
11 | return GetPlayers();
12 | }
13 |
14 | public Player Get(GetPlayer request)
15 | {
16 | return GetPlayers().Single(p => p.Id == request.Id);
17 | }
18 |
19 | private List GetPlayers()
20 | {
21 | return new List
22 | {
23 | new Player{ Id= 1, FirstName="Angela", LastName = "Evans"},
24 | new Player{ Id= 2, FirstName="Jack", LastName = "Marshall"},
25 | };
26 | }
27 | }
28 |
29 | [Route("/players", "GET")]
30 | public class GetPlayers : IReturn>
31 | {
32 | }
33 |
34 | [Route("/players/{Id}", "GET")]
35 | public class GetPlayer : IReturn
36 | {
37 | public int Id { get; set; }
38 | }
39 |
40 | public class Player
41 | {
42 | public int Id { get; set; }
43 |
44 | public string FirstName { get; set; }
45 |
46 | public string LastName { get; set; }
47 | }
48 | }
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example2")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example2")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("25adcb82-84ad-49f2-9fa9-48fbdebfd5e7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter3/Example3/Example3.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example3.Web", "Example3.Web\Example3.Web.csproj", "{E1675FF2-D428-4FD7-84E8-C968B552459B}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/AppHost.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.ServiceInterface.Validation;
2 | using ServiceStack.WebHost.Endpoints;
3 |
4 | namespace Example4.Web
5 | {
6 | public class AppHost : AppHostBase
7 | {
8 | public AppHost()
9 | : base("Chapter3 Example4", typeof (AppHost).Assembly)
10 | {
11 | }
12 |
13 | public override void Configure(Funq.Container container)
14 | {
15 | container.RegisterAutoWired();
16 |
17 | Plugins.Add(new ValidationFeature());
18 |
19 | container.RegisterValidators(typeof(AppHost).Assembly);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/GetPlayer.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.ServiceHost;
2 |
3 | namespace Example4.Web
4 | {
5 | [Route("/players/{Id}", "GET")]
6 | public class GetPlayer : IReturn
7 | {
8 | public int Id { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/GetPlayers.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using ServiceStack.ServiceHost;
3 |
4 | namespace Example4.Web
5 | {
6 | [Route("/players", "GET")]
7 | public class GetPlayers : IReturn>
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Example4.Web.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Example4.Web
4 | {
5 | public class Global : System.Web.HttpApplication
6 | {
7 |
8 | protected void Application_Start(object sender, EventArgs e)
9 | {
10 | new AppHost().Init();
11 | }
12 |
13 | protected void Session_Start(object sender, EventArgs e)
14 | {
15 |
16 | }
17 |
18 | protected void Application_BeginRequest(object sender, EventArgs e)
19 | {
20 |
21 | }
22 |
23 | protected void Application_AuthenticateRequest(object sender, EventArgs e)
24 | {
25 |
26 | }
27 |
28 | protected void Application_Error(object sender, EventArgs e)
29 | {
30 |
31 | }
32 |
33 | protected void Session_End(object sender, EventArgs e)
34 | {
35 |
36 | }
37 |
38 | protected void Application_End(object sender, EventArgs e)
39 | {
40 |
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Player.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.ServiceHost;
2 |
3 | namespace Example4.Web
4 | {
5 | [Route("/players", "POST")]
6 | public class Player : IReturn
7 | {
8 | public int Id { get; set; }
9 |
10 | public string FirstName { get; set; }
11 |
12 | public string LastName { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/PlayerValidator.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.FluentValidation;
2 |
3 | namespace Example4.Web
4 | {
5 | public class PlayerValidator : AbstractValidator
6 | {
7 | public PlayerValidator()
8 | {
9 | RuleFor(p => p.FirstName).NotEmpty();
10 | RuleFor(p => p.LastName).NotEmpty();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/PlayersRepository.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Example4.Web
4 | {
5 | public class PlayersRepository
6 | {
7 | private List _players = new List
8 | {
9 | new Player{ Id= 1, FirstName="Angela", LastName = "Evans"},
10 | new Player{ Id= 2, FirstName="Jack", LastName = "Marshall"},
11 | };
12 |
13 | public List GetPlayers()
14 | {
15 | return _players;
16 | }
17 |
18 | public void AddPlayer(Player player)
19 | {
20 | player.Id = _players.Count + 1;
21 | _players.Add(player);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/PlayersService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using ServiceStack.ServiceHost;
4 |
5 | namespace Example4.Web
6 | {
7 | public class PlayersService : IService
8 | {
9 | public PlayersRepository Repository { get; set; }
10 |
11 | public List Get(GetPlayers request)
12 | {
13 | return Repository.GetPlayers();
14 | }
15 |
16 | public Player Get(GetPlayer request)
17 | {
18 | return Repository.GetPlayers().Single(p => p.Id == request.Id);
19 | }
20 |
21 | public Player Post(Player player)
22 | {
23 | Repository.AddPlayer(player);
24 | return player;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Example2")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Example2")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("25adcb82-84ad-49f2-9fa9-48fbdebfd5e7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter3/Example4/Example4.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30110.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example4.Web", "Example4.Web\Example4.Web.csproj", "{E1675FF2-D428-4FD7-84E8-C968B552459B}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E1675FF2-D428-4FD7-84E8-C968B552459B}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Alex Pop
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | angularjs-dotnet-book
2 | =====================
3 |
4 | Examples for the concepts introduced in the first three chapters from my book "Learning AngularJS for .Net Developers" available to order [here](http://bit.ly/1sUFzQj).
5 | There is another repository with the main application example from the same book covering the last three chapters available at [github.com/popalexandruvasile/rentthatbike](https://github.com/popalexandruvasile/rentthatbike).
6 | There are two blog posts introducing this book:
7 | [Announcing my upcoming book "Learning AngularJS for .NET developers"](http://alexvpop.blogspot.co.uk/2014/06/announcing-learning-angularjs-dotnet.html)
8 | [Free sample chapter "Testing and Debugging AngularJS Applications" from my recently launched book](http://alexvpop.blogspot.com/2014/07/free-sample-chapter-testing-angularjs.html)
9 |
10 | #Examples index
11 | ##Chapter 1: Introducing AngularJS
12 | All examples apart from Example 1 are showcasing AngularJS components and patterns.
13 | ###Fundamentals
14 | Example 1 - typical jQuery based form. [Source](Chapter1/Example1), [plnkr](http://plnkr.co/edit/nqF38J?p=preview)
15 | Example 2 - AngularJS version of the jQuery based form with no JavaScript. [Source](Chapter1/Example2), [plnkr](http://plnkr.co/edit/UNRH3j?p=preview)
16 | Example 3 - Introducing the controller. [Source](Chapter1/Example3), [plnkr](http://plnkr.co/edit/qbNJm4?p=preview)
17 | Example 4 - Introducing the application module. [Source](Chapter1/Example4), [plnkr](http://plnkr.co/edit/yWVc96?p=preview)
18 | Example 5 - Application module using IIFE. [Source](Chapter1/Example5), [plnkr](http://plnkr.co/edit/hxVxHU?p=preview)
19 | Example 6 - The revealing module pattern. [Source](Chapter1/Example6), [plnkr](http://plnkr.co/edit/YFvyEa?p=preview)
20 | Example 7 - Explicit dependency injection. [Source](Chapter1/Example7), [plnkr](http://plnkr.co/edit/73Y9yf?p=preview)
21 | Example 8 - Form with two controllers. [Source](Chapter1/Example8), [plnkr](http://plnkr.co/edit/gmyCY8?p=preview)
22 | Example 9 - Form with with two controllers with a service encapsulating redundant code. [Source](Chapter1/Example9), [plnkr](http://plnkr.co/edit/a4AwKj?p=preview)
23 | Example 10 - The ngRepeat directive. [Source](Chapter1/Example10), [plnkr](http://plnkr.co/edit/ap8vhe?p=preview)
24 | Example 11 - The ngRepeatStart and ngRepeatEnd directives. [Source](Chapter1/Example11), [plnkr](http://plnkr.co/edit/XP1Qpy?p=info)
25 | Example 12 - The ngInclude directive. [Source](Chapter1/Example12), [plnkr](http://plnkr.co/edit/cm5le9?p=preview)
26 | ###Custom directives
27 | Example 13 - Simple custom directive. [Source](Chapter1/Example13), [plnkr](http://plnkr.co/edit/KSILvS?p=preview)
28 | Example 14 - Custom directive with isolated scope. [Source](Chapter1/Example14), [plnkr](http://plnkr.co/edit/OjvHhD?p=preview)
29 | Example 15 - Custom directive with isolated scope and scope property. [Source](Chapter1/Example15), [plnkr](http://plnkr.co/edit/5shUaa?p=preview)
30 | ###Filters
31 | Example 16 - Filters. [Source](Chapter1/Example16), [plnkr](http://plnkr.co/edit/hN9PBZ?p=preview)
32 | Example 17 - Filters executed in controller. [Source](Chapter1/Example17), [plnkr](http://plnkr.co/edit/CVYRe0?p=preview)
33 | Example 18 - Custom filter. [Source](Chapter1/Example18), [plnkr](http://plnkr.co/edit/Sq0jGg?p=preview)
34 | ##Chapter 2: Creating an AngularJS Client-side Application in Visual Studio
35 | Example 1 - Chapter1 Example18 is converted to a Visual Studio ASP.NET Empty Web application project. [Source](Chapter2/Example1)
36 | Example 2 - Using NuGet to manage AngularJS packages. [Source](Chapter2/Example2)
37 | Example 3 - Using Bootstrap grid system. [Source](Chapter2/Example3)
38 | Example 4 - AngularJS code organization for medium projects. [Source](Chapter2/Example4)
39 | Example 5 - AngularJS code organization for larger projects. [Source](Chapter2/Example5)
40 | Example 6 - Integration with native browser API and $scope.$apply(). [Source](Chapter2/Example6)
41 | Example 7 - AngularJS routing. [Source](Chapter2/Example7)
42 | ##Chapter 3: Creating .NET Web Services for AngularJS
43 | Example 1 - A ServiceStack barebones project. [Source](Chapter3/Example1)
44 | Example 2 - Creating web services in ServiceStack and calling them using the C# client. [Source](Chapter3/Example2)
45 | Example 3 - Global request filter in ServiceStack. [Source](Chapter3/Example3)
46 | Example 4 - Dependency injection with ServiceStack and automatic request validation. [Source](Chapter3/Example4)
47 |
--------------------------------------------------------------------------------