-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathatom.xml
More file actions
407 lines (337 loc) · 23.9 KB
/
atom.xml
File metadata and controls
407 lines (337 loc) · 23.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[The fastest and smoothest way to good architecture]]></title>
<link href="http://hwyfwk.com/atom.xml" rel="self"/>
<link href="http://hwyfwk.com/"/>
<updated>2019-10-02T01:26:19-05:00</updated>
<id>http://hwyfwk.com/</id>
<author>
<name><![CDATA[Tim Rayburn & Devlin Liles]]></name>
<email><![CDATA[Team@HwyFwk.com]]></email>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[New Jekyll Version]]></title>
<link href="http://hwyfwk.com/blog/2016/04/02/new-jekyll-version/"/>
<updated>2016-04-02T14:21:00-05:00</updated>
<id>http://hwyfwk.com/blog/2016/04/02/new-jekyll-version</id>
<content type="html"><![CDATA[<p>We have updated the Highway Framework website to use the latest version of Jekyll.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Pavement v0.5]]></title>
<link href="http://hwyfwk.com/blog/2016/04/02/highway-dot-pavement-v0-dot-5/"/>
<updated>2016-04-02T14:21:00-05:00</updated>
<id>http://hwyfwk.com/blog/2016/04/02/highway-dot-pavement-v0-dot-5</id>
<content type="html"><![CDATA[<h1 id="changes">Changes</h1>
<ul>
<li>Adding a strong name key to the Highway.Pavement assembly so it can be referenced from signed assemblies.</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Pavement v0.4]]></title>
<link href="http://hwyfwk.com/blog/2016/04/02/highway-dot-pavement-v0-dot-4/"/>
<updated>2016-04-02T12:46:00-05:00</updated>
<id>http://hwyfwk.com/blog/2016/04/02/highway-dot-pavement-v0-dot-4</id>
<content type="html"><![CDATA[<h1 id="changes">Changes</h1>
<ul>
<li>Added support for CoreCLR to the package</li>
<li>Removed dependency on <code class="highlighter-rouge">Common.Logging</code> until such time as they support CoreCLR themselves.</li>
</ul>
<h1 id="notes">Notes</h1>
<ul>
<li>The CoreCLR conversion of all of Highway Framework has begun, this is the first drop, more will come.</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v6.0.4.1 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/10/20/highway-dot-data-v6-dot-0-4-2-released/"/>
<updated>2015-10-20T12:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2015/10/20/highway-dot-data-v6-dot-0-4-2-released</id>
<content type="html"><![CDATA[<ul>
<li>Updated to remove chance of calling non-writable properties – Thanks Ed Blakes</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v6.0.4.1 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/10/13/highway-dot-data-v6-dot-0-4-1-released/"/>
<updated>2015-10-13T12:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2015/10/13/highway-dot-data-v6-dot-0-4-1-released</id>
<content type="html"><![CDATA[<ul>
<li>Updated Async API and Sync API to be independent</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v6.0.4 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/07/29/highway-dot-data-v6-dot-0-4-released/"/>
<updated>2015-07-29T12:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2015/07/29/highway-dot-data-v6-dot-0-4-released</id>
<content type="html"><![CDATA[<ul>
<li>Added <code class="highlighter-rouge">Context</code> on <code class="highlighter-rouge">Command</code> and <code class="highlighter-rouge">Scalar</code> Interceptors – Thanks Marcin Dzwonnik</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v6.0.3 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/07/17/highway-dot-data-v6-dot-0-3-released/"/>
<updated>2015-07-17T12:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2015/07/17/highway-dot-data-v6-dot-0-3-released</id>
<content type="html"><![CDATA[<ul>
<li>Fixed bug that allowed <code class="highlighter-rouge">InMemoryDataContext</code> to return null results</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v6.0.1 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/07/07/highway-dot-data-v6-dot-0-1-released/"/>
<updated>2015-07-07T16:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2015/07/07/highway-dot-data-v6-dot-0-1-released</id>
<content type="html"><![CDATA[<ul>
<li>Fixing null reference in adding back reference to non-existent collection</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v6.0.0 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/07/07/highway-dot-data-v6-dot-0-0-released/"/>
<updated>2015-07-07T12:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2015/07/07/highway-dot-data-v6-dot-0-0-released</id>
<content type="html"><![CDATA[<ul>
<li>Adding back reference population for <code class="highlighter-rouge">InMemoryDataContext</code></li>
<li>Adding Async API for <code class="highlighter-rouge">DataContext</code></li>
<li>Adding Expand behavior config option for OData provider</li>
<li>Adding Enum to Text and Enum to Number support for OData provider</li>
<li>Updated Entity Framework minimum dependency to 6.1.3</li>
<li>Fixed an issue with inherited objects not returning for queries on <code class="highlighter-rouge">InMemoryDataContext</code></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.2.0 Released]]></title>
<link href="http://hwyfwk.com/blog/2015/02/03/highway-dot-data-v5-dot-2-0-released/"/>
<updated>2015-02-03T12:00:00-06:00</updated>
<id>http://hwyfwk.com/blog/2015/02/03/highway-dot-data-v5-dot-2-0-released</id>
<content type="html"><![CDATA[<ul>
<li>Adding Virtual keyword for <code class="highlighter-rouge">DataContext</code> extension to most methods</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.1.3 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/12/29/highway-dot-data-v5-dot-1-3-released/"/>
<updated>2014-12-29T12:00:00-06:00</updated>
<id>http://hwyfwk.com/blog/2014/12/29/highway-dot-data-v5-dot-1-3-released</id>
<content type="html"><![CDATA[<ul>
<li>Fixed <code class="highlighter-rouge">StackOverflowException</code> in <code class="highlighter-rouge">InMemoryDataContext</code></li>
<li>Alignment fix in Readme.markdown – Thanks Ken Dale</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.1.1 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/06/11/highway-dot-data-v5-dot-1-1-released/"/>
<updated>2014-06-11T12:00:00-05:00</updated>
<id>http://hwyfwk.com/blog/2014/06/11/highway-dot-data-v5-dot-1-1-released</id>
<content type="html"><![CDATA[<ul>
<li>Adding Fluent query for testing <code class="highlighter-rouge">FindWhere</code> under prebuilt queries. – Thanks Philip Mateescu</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.1.0 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/04/28/highway-dot-data-v5-dot-1-0-released/"/>
<updated>2014-04-28T22:37:00-05:00</updated>
<id>http://hwyfwk.com/blog/2014/04/28/highway-dot-data-v5-dot-1-0-released</id>
<content type="html"><![CDATA[<ul>
<li><code class="highlighter-rouge">DomainRepositoryFactory</code> doesn’t throw on null event collection – Eric Burcham</li>
<li>Added <code class="highlighter-rouge">InMemoryActiveDataContext</code> to allow for multiple repositories using a single in memory – The beginnings of a “prod” in memory context – Long Mai</li>
<li>Queued Add and Remove – <code class="highlighter-rouge">InMemoryDataContext</code> now acts more like a real database as it doesn’t return added records or modify collections in loops. – Long Mai</li>
<li>Identity Strategies are invoked automatically on commit – Long Mai</li>
<li>Brought back .NET 4.0 support</li>
<li>Updated to Entity Framework 6.0.2</li>
<li>Updated to CommonServiceLocator 1.2</li>
<li>Updated to Common.Logging 2.2.0</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.OnRamp.MVC v3.0.2 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/04/10/highway-dot-onramp-dot-mvc-v3-dot-0-2-released/"/>
<updated>2014-04-10T11:18:00-05:00</updated>
<id>http://hwyfwk.com/blog/2014/04/10/highway-dot-onramp-dot-mvc-v3-dot-0-2-released</id>
<content type="html"><![CDATA[<p>Today we released a minor bug fix to the Highway.OnRamp.MVC packages, this included the following changes:</p>
<ul>
<li>Moving <code class="highlighter-rouge">BaseRestApiController</code> from Highway.OnRamp.MVC to Highway.OnRamp.MVC.Data. This was an error in packaging previously which resulted in errors if you only installed Highway.OnRamp.MVC.</li>
<li>Increased the dependency version of Highway.OnRamp.MVC.Data for Highway.Data from v5.0 to v5.0.6. This removes the requirement for you to be using .NET Framework v4.5.1 and now merely required .NET Framework v4.5.</li>
</ul>
<p>All other functionality is unchanged, all current documentation is still accurate.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.0.7 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/03/22/highway-dot-data-v5-dot-0-7-released/"/>
<updated>2014-03-22T10:47:00-05:00</updated>
<id>http://hwyfwk.com/blog/2014/03/22/highway-dot-data-v5-dot-0-7-released</id>
<content type="html"><![CDATA[<p>More contributions from, Eric Burcham and Long Mai! Thank you gentlemen for your support.</p>
<ul>
<li>Bug Fix : <a href="https://github.com/HighwayFramework/Highway.Data/pull/56">GetById Documentation</a></li>
<li>Bug Fix : <a href="https://github.com/HighwayFramework/Highway.Data/pull/55">Additional Identity Strategies and Auto-increment Id for IIdentifiable’s</a></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.0.6 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/03/15/highway-dot-data-v5-dot-0-6-released/"/>
<updated>2014-03-15T10:47:00-05:00</updated>
<id>http://hwyfwk.com/blog/2014/03/15/highway-dot-data-v5-dot-0-6-released</id>
<content type="html"><![CDATA[<p>More contributions from @longility in this release, and an incubating feature, which will be promoted to a full feature in a future release:</p>
<ul>
<li>Bug Fix : <a href="https://github.com/HighwayFramework/Highway.Data/pull/54">Support for bidirectional and circular entity references for InMemoryDataContext</a></li>
<li>Incubating Feature : <a href="https://github.com/HighwayFramework/Highway.Data/pull/53">New SQL Query objects for EF</a></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.Data v5.0.5 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/03/10/highway-dot-data-v5-dot-0-5-released/"/>
<updated>2014-03-10T10:47:00-05:00</updated>
<id>http://hwyfwk.com/blog/2014/03/10/highway-dot-data-v5-dot-0-5-released</id>
<content type="html"><![CDATA[<p>This release is brought to you by two new contributors, Eric Burcham and Long Mai! Thank you gentlemen for your support.</p>
<ul>
<li>Bug Fix : <a href="https://github.com/HighwayFramework/Highway.Data/pull/52">Support adding element directly and indirectly to InMemoryDataContext.</a></li>
<li>Bug Fix : <a href="https://github.com/HighwayFramework/Highway.Data/pull/51">Improved documentation for IDomainRepositoryFactory</a></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Session and Configuration access via Interfaces]]></title>
<link href="http://hwyfwk.com/blog/2014/01/25/session-and-configuration-access-via-interfaces/"/>
<updated>2014-01-25T19:33:00-06:00</updated>
<id>http://hwyfwk.com/blog/2014/01/25/session-and-configuration-access-via-interfaces</id>
<content type="html"><![CDATA[<p>There are two things which are historically very hard to deal with when unit testing a websites, these are configuration values, and session variables. They both present largely the same problem, they are normally accessible via an API that is not conducive to testing, both are static classes, and that API retrieves data from them via “magic strings”. The Castle Project has a wonderful component within it called <code class="highlighter-rouge">DictionaryAdapter</code> which can help solve these pains for us very easily, once you understand how it works.</p>
<h1 id="dictionary-adapter">Dictionary Adapter</h1>
<p>Dictionary Adapter is a class which creates classes at runtime that implement an interface you specify, and wires the properties of said interface to access a key value store you specify. For instance, let’s assume you have the following interface:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>public interface IConnectionStringConfig
{
string ConnectionString { get; }
}
</code></pre></div></div>
<p>And the following configuration settings in your web.config:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <appSettings>
<add key="ConnectionString" value="Server=.;Database=ChangeMyConnectionString;Integrated Security=true;" />
</appSettings>
</code></pre></div></div>
<p>Now we can ask Dictionary Adapter to create an instance of <code class="highlighter-rouge">IConnectionString</code>, and supply it the app settings from our web.config. It will return to us a class which implements our interface, and when that when the <code class="highlighter-rouge">ConnectionString</code> property is accessed, will retrieve the value from app settings.</p>
<p>Now instead of writing controllers, or other classes which access app settings directly from the <code class="highlighter-rouge">ConfigurationManager</code>, we can instead simply take a dependency on <code class="highlighter-rouge">IConnectionString</code>, and that class can in turn use a strongly typed (no magic strings) and testable (simply mock the interface) way of accessing app settings.</p>
<p>Just as we can do this with the key value store of app settings, we can also do it with the key value store of <code class="highlighter-rouge">Session</code> as well. This makes accessing session also no longer require magic strings, and addresses the problem of mocking an <code class="highlighter-rouge">HttpContext</code> for <code class="highlighter-rouge">Session</code>.</p>
<h1 id="wiring-it-up-with-windsor">Wiring it up with Windsor</h1>
<p>As awesome as that is, manually registering all of the configuration or session interfaces would be rather tedious in the extreme. As such we’ve created some conventions you can use that will automatically register these interfaces for you.</p>
<h2 id="config-interfaces">Config interfaces</h2>
<p>Any interface in your application’s assembly which has a name that ends in <strong>Config</strong> will automatically be registered with our IoC container with a class instance provided by <code class="highlighter-rouge">DictionaryAdapter</code>. These classes are registered as Singleton lifestyle, because they continue to directly access the <code class="highlighter-rouge">ConfigurationManager</code> and so even if your configuration values change at runtime, they will stay up to date.</p>
<h2 id="session-interfaces">Session interfaces</h2>
<p>Any interface in your application’s assembly which has a name that ends in <strong>Session</strong> will automatically be registered with our IoC container with a class instance provided by <code class="highlighter-rouge">DictionaryAdapter</code>. These classes are registered with a <code class="highlighter-rouge">PerWebRequest</code> lifestyle, because every request will have a different <code class="highlighter-rouge">HttpContext</code>.</p>
<h1 id="what-about-keys-which-dont-match-property-names">What about keys which don’t match property names?</h1>
<p>A common scenario for users of DictionaryAdapter to run into is that they want properties on their interfaces which do not match their key value store’s key values exactly. This is easy to run into simply because of the limitations of property names, for instance “ida:ClientSecret” is not a valid property name. So how do we handle this?</p>
<p>DictionaryAdapter provides a set of attributes which can help address these concerns. We’ll talk about each in turn, here they are:</p>
<ul>
<li><code class="highlighter-rouge">KeyAttribute</code></li>
<li><code class="highlighter-rouge">KeyPrefixAttribute</code></li>
<li><code class="highlighter-rouge">KeySuffixAttribute</code></li>
</ul>
<h2 id="key">Key</h2>
<p>The simplest and often most useful of our helper attributes is <code class="highlighter-rouge">KeyAttribute</code>. This attribute when applied to a property completely changes the key in the key value store that is accessed for our property. For instance, given the following interface, the <code class="highlighter-rouge">ConnectionSting</code> property returns “Foo” setting instead of “ConnectionString” because of the <code class="highlighter-rouge">KeyAttribute</code>.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>public interface IExampleConfig
{
[Key("Foo")]
string ConnectionString { get; }
}
</code></pre></div></div>
<h2 id="keyprefixattribute">KeyPrefixAttribute</h2>
<p>The next most common attribute to be used, and one which we use by default in the Data extension to the OnRamp, is <code class="highlighter-rouge">KeyPrefixAttirbute</code>. This attribute is applied to the interface, not the properties, and affects the keys used in the key value store for all properties on that interface. For instance, given the following interface, the ConnectionSting property returns “FooConnectionString” setting instead of “ConnectionString” because of the <code class="highlighter-rouge">KeyPrefixAttribute</code>.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>public interface IExampleConfig
{
[KeyPrefix("Foo")]
string ConnectionString { get; }
}
</code></pre></div></div>
<h2 id="keysuffixattribute">KeySuffixAttribute</h2>
<p>The third and final attribute we will discuss here is <code class="highlighter-rouge">KeySuffixAttribute</code>. Like <code class="highlighter-rouge">KeyPrefixAttribute</code> this is applied to the interface, not the property, and affects the key values for all properties on that interface. For instance, given the following interface, the <code class="highlighter-rouge">ConnectionSting</code> property returns “ConnectionStringFoo” setting instead of “ConnectionString” because of the <code class="highlighter-rouge">KeySuffixAttribute</code>.</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>public interface IExampleConfig
{
[Key("Foo")]
string ConnectionString { get; }
}
</code></pre></div></div>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Highway.OnRamp.MVC v3.0 Released]]></title>
<link href="http://hwyfwk.com/blog/2014/01/25/highway-dot-onramp-dot-mvc-v3-dot-0-released/"/>
<updated>2014-01-25T19:27:00-06:00</updated>
<id>http://hwyfwk.com/blog/2014/01/25/highway-dot-onramp-dot-mvc-v3-dot-0-released</id>
<content type="html"><![CDATA[<p>We are pleased to announce the release of Highway.OnRamp.MVC v3.0. The following are the major features now included:</p>
<ul>
<li>Major restructuring to organize and rename a lot of pieces</li>
<li>ApiController dependency injection</li>
<li>Automatic IoC registrations</li>
<li>Session and Configuration access via Interfaces</li>
<li>Easy RESTful ApiControllers</li>
<li>Injectable Filters</li>
<li>Support for Highway.Data v5 (and through it Entity Framework v6)</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Easy RESTful ApiControllers]]></title>
<link href="http://hwyfwk.com/blog/2014/01/25/easy-restful-apicontrollers/"/>
<updated>2014-01-25T19:09:00-06:00</updated>
<id>http://hwyfwk.com/blog/2014/01/25/easy-restful-apicontrollers</id>
<content type="html"><![CDATA[<p>Using the Domain concepts and Prebuilt Queries of Highway.Data, we have included a basic RESTful base class for your ApiControllers. This feature is very easy to use, simply inherit from <code class="highlighter-rouge">BaseRestApiController</code>. That base class has two constructor requirements:</p>
<ol>
<li><code class="highlighter-rouge">IDomainRepositoryFactory</code> this class comes from Highway.Data and is already registered with our IoC.</li>
<li><code class="highlighter-rouge">RestfulOperations</code> this is a <strong>FLAGS</strong> enumeration that lets you control how the base class behaves.</li>
</ol>
<p>An implementation controller would look like this:</p>
<div class="language-csharp highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">public</span> <span class="k">class</span> <span class="nc">DriverController</span> <span class="p">:</span> <span class="n">BaseRestApiController</span><span class="p"><</span><span class="n">Domain</span><span class="p">,</span> <span class="n">Driver</span><span class="p">,</span> <span class="n">Guid</span><span class="p">></span>
<span class="p">{</span>
<span class="k">public</span> <span class="nf">DriverController</span><span class="p">(</span><span class="n">IDomainRepositoryFactory</span> <span class="n">factory</span><span class="p">)</span> <span class="p">:</span>
<span class="k">base</span><span class="p">(</span><span class="n">factory</span><span class="p">,</span> <span class="n">RestfulOperations</span><span class="p">.</span><span class="n">All</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
<span class="k">public</span> <span class="k">override</span> <span class="nf">CopyEntityValues</span><span class="p">(</span><span class="n">Driver</span> <span class="n">source</span><span class="p">,</span> <span class="n">Driver</span> <span class="n">destination</span><span class="p">)</span>
<span class="p">{</span>
<span class="c1">// copy values from one instance to another here.</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>
<p>This class would support all five of our pre-built functions, because it passed <code class="highlighter-rouge">RestfulOperations.All</code>, these are:</p>
<ul>
<li>GetAll - This is the default get with no <code class="highlighter-rouge">id</code> and returns ALL Drivers</li>
<li>GetOne - This returns one driver, by <code class="highlighter-rouge">id</code></li>
<li>Put - Accepts a <code class="highlighter-rouge">PUT</code> verb and updates a singular Driver. Uses <code class="highlighter-rouge">CopyEntityValues</code> above to control what can be updated.</li>
<li>Delete - Deletes a Driver by <code class="highlighter-rouge">id</code></li>
<li>Post - Accepts a <code class="highlighter-rouge">POST</code> verb and inserts a singular Driver.</li>
</ul>
<p>Importantly this enums is <strong>FLAGS</strong> based, and as such the values can be OR’ed together. For instance, if you wanted to just support GetOne and Post you could change the line above to:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> public DriverController(IDomainRepositoryFactory factory) :
base(factory, RestfulOperations.GetOne | RestfulOperations.Post) { }
</code></pre></div></div>
<p>There are some logical pre-built combinations already supported in the enum, which is defined as follows:</p>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> [Flags]
public enum RestOperations
{
GetAll = 1,
GetOne = 2,
Post = 4,
Put = 8,
Delete = 16,
ReadOnly = 3,
WriteOnly = 28,
All = 31
}
</code></pre></div></div>
]]></content>
</entry>
</feed>