-
Notifications
You must be signed in to change notification settings - Fork 0
/
a00292.html
563 lines (530 loc) · 31.2 KB
/
a00292.html
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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Enterprise Library Data Access Application Block: Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor< TResult > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="entlib_new_icon_100x100.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Enterprise Library Data Access Application Block
 <span id="projectnumber">7.0-rc1</span>
</div>
<div id="projectbrief">The Data Access Application Block abstracts the actual database you are using, and exposes a collection of methods that make it easy to access that database and to perform common tasks.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00292.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-methods">Protected Member Functions</a> |
<a href="#properties">Properties</a> |
<a href="a00289.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor< TResult > Class Template Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Base class for Data Accessors that execute a DbCommand.
<a href="a00292.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor< TResult >:</div>
<div class="dyncontent">
<div class="center">
<img src="a00292.png" usemap="#Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor_3C_20TResult_20_3E_map" alt=""/>
<map id="Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor_3C_20TResult_20_3E_map" name="Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor_3C_20TResult_20_3E_map">
<area href="a00424.html" title="An abstract class representing an object that wraps a database operation. An Accessor is executed,..." alt="Microsoft.Practices.EnterpriseLibrary.Data.DataAccessor< TResult >" shape="rect" coords="221,0,654,24"/>
<area href="a00524.html" title="Represents a stored procedure call to the database that will return an enumerable of TResult ." alt="Microsoft.Practices.EnterpriseLibrary.Data.SprocAccessor< TResult >" shape="rect" coords="0,112,433,136"/>
<area href="a00532.html" title="Represents a call to the database using SQL that will return an enumerable of TResult ." alt="Microsoft.Practices.EnterpriseLibrary.Data.SqlStringAccessor< TResult >" shape="rect" coords="443,112,876,136"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a00c4dfe207766604466424e65f8ca51c"><td class="memItemLeft" align="right" valign="top">override IEnumerable< TResult > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#a00c4dfe207766604466424e65f8ca51c">EndExecute</a> (IAsyncResult asyncResult)</td></tr>
<tr class="memdesc:a00c4dfe207766604466424e65f8ca51c"><td class="mdescLeft"> </td><td class="mdescRight">Complete an operation started by <a class="el" href="a00424.html#a4970e059d6d67ddd47d7c8766838b524" title="Begin executing the database object asynchronously, returning a IAsyncResult object that can be used ...">DataAccessor<TResult>.BeginExecute</a>. <a href="a00292.html#a00c4dfe207766604466424e65f8ca51c">More...</a><br /></td></tr>
<tr class="separator:a00c4dfe207766604466424e65f8ca51c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b6d7d77c85f574e380a113e7c1f22c1"><td class="memItemLeft" align="right" valign="top">abstract IEnumerable< TResult > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00424.html#a8b6d7d77c85f574e380a113e7c1f22c1">Execute</a> (params object[] parameterValues)</td></tr>
<tr class="memdesc:a8b6d7d77c85f574e380a113e7c1f22c1"><td class="mdescLeft"> </td><td class="mdescRight">Execute the database operation synchronously, returning the IEnumerable<TResult> sequence containing the resulting objects. <a href="a00424.html#a8b6d7d77c85f574e380a113e7c1f22c1">More...</a><br /></td></tr>
<tr class="separator:a8b6d7d77c85f574e380a113e7c1f22c1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4970e059d6d67ddd47d7c8766838b524"><td class="memItemLeft" align="right" valign="top">abstract IAsyncResult </td><td class="memItemRight" valign="bottom"><a class="el" href="a00424.html#a4970e059d6d67ddd47d7c8766838b524">BeginExecute</a> (AsyncCallback callback, object state, params object[] parameterValues)</td></tr>
<tr class="memdesc:a4970e059d6d67ddd47d7c8766838b524"><td class="mdescLeft"> </td><td class="mdescRight">Begin executing the database object asynchronously, returning a IAsyncResult object that can be used to retrieve the result set after the operation completes. <a href="a00424.html#a4970e059d6d67ddd47d7c8766838b524">More...</a><br /></td></tr>
<tr class="separator:a4970e059d6d67ddd47d7c8766838b524"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a9953489e703640c45bb03132183282c7"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#a9953489e703640c45bb03132183282c7">CommandAccessor</a> (<a class="el" href="a00428.html">Database</a> database, <a class="el" href="a00472.html">IRowMapper</a>< TResult > rowMapper)</td></tr>
<tr class="memdesc:a9953489e703640c45bb03132183282c7"><td class="mdescLeft"> </td><td class="mdescRight">Initialized the <a class="el" href="a00292.html#a9953489e703640c45bb03132183282c7" title="Initialized the CommandAccessor<TResult> with a database instance and a Row Mapper.">CommandAccessor<TResult></a> with a database instance and a Row Mapper. <a href="a00292.html#a9953489e703640c45bb03132183282c7">More...</a><br /></td></tr>
<tr class="separator:a9953489e703640c45bb03132183282c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a96ea9d435d797e8a9e8c8540a1a23857"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#a96ea9d435d797e8a9e8c8540a1a23857">CommandAccessor</a> (<a class="el" href="a00428.html">Database</a> database, <a class="el" href="a00468.html">IResultSetMapper</a>< TResult > resultSetMapper)</td></tr>
<tr class="memdesc:a96ea9d435d797e8a9e8c8540a1a23857"><td class="mdescLeft"> </td><td class="mdescRight">Initialized the <a class="el" href="a00292.html#a9953489e703640c45bb03132183282c7" title="Initialized the CommandAccessor<TResult> with a database instance and a Row Mapper.">CommandAccessor<TResult></a> with a database instance and a Row Mapper. <a href="a00292.html#a96ea9d435d797e8a9e8c8540a1a23857">More...</a><br /></td></tr>
<tr class="separator:a96ea9d435d797e8a9e8c8540a1a23857"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af7e06ccea7ae67c366467e6e6c7c1d1d"><td class="memItemLeft" align="right" valign="top">IEnumerable< TResult > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#af7e06ccea7ae67c366467e6e6c7c1d1d">Execute</a> (DbCommand command)</td></tr>
<tr class="memdesc:af7e06ccea7ae67c366467e6e6c7c1d1d"><td class="mdescLeft"> </td><td class="mdescRight">Executes the <em>command</em> and returns an enumerable of <em>TResult</em> . The enumerable returned by this method uses deferred loading to return the results. <a href="a00292.html#af7e06ccea7ae67c366467e6e6c7c1d1d">More...</a><br /></td></tr>
<tr class="separator:af7e06ccea7ae67c366467e6e6c7c1d1d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0f84abef7bf86eae0377e5aaf928d67f"><td class="memItemLeft" align="right" valign="top">IAsyncResult </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#a0f84abef7bf86eae0377e5aaf928d67f">BeginExecute</a> (DbCommand command, <a class="el" href="a00464.html">IParameterMapper</a> parameterMapper, AsyncCallback callback, object state, object[] parameterValues)</td></tr>
<tr class="memdesc:a0f84abef7bf86eae0377e5aaf928d67f"><td class="mdescLeft"> </td><td class="mdescRight">Helper method to kick off execution of an asynchronous database operation. This method handles the boilerplate of setting up the parameters and invoking the operation on the database with the right options. <a href="a00292.html#a0f84abef7bf86eae0377e5aaf928d67f">More...</a><br /></td></tr>
<tr class="separator:a0f84abef7bf86eae0377e5aaf928d67f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abbd4d072c1b9d993e47ceeff44c952dc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#abbd4d072c1b9d993e47ceeff44c952dc">GuardAsyncAllowed</a> ()</td></tr>
<tr class="memdesc:abbd4d072c1b9d993e47ceeff44c952dc"><td class="mdescLeft"> </td><td class="mdescRight">Checks if the current <a class="el" href="a00428.html" title="Represents an abstract database that commands can be run against.">Database</a> object supports asynchronous operations, and throws InvalidOperationException if not. <a href="a00292.html#abbd4d072c1b9d993e47ceeff44c952dc">More...</a><br /></td></tr>
<tr class="separator:abbd4d072c1b9d993e47ceeff44c952dc"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:a9e037b56538aa928482c69d4ff8044e5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00428.html">Database</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html#a9e037b56538aa928482c69d4ff8044e5">Database</a><code> [get]</code></td></tr>
<tr class="memdesc:a9e037b56538aa928482c69d4ff8044e5"><td class="mdescLeft"> </td><td class="mdescRight">The database object this accessor is wrapped around. <a href="a00292.html#a9e037b56538aa928482c69d4ff8044e5">More...</a><br /></td></tr>
<tr class="separator:a9e037b56538aa928482c69d4ff8044e5"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Base class for Data Accessors that execute a DbCommand. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">TResult</td><td>The element type this accessor will return.</td></tr>
</table>
</dd>
</dl>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a9953489e703640c45bb03132183282c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9953489e703640c45bb03132183282c7">◆ </a></span>CommandAccessor() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.<a class="el" href="a00292.html">CommandAccessor</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00428.html">Database</a> </td>
<td class="paramname"><em>database</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00472.html">IRowMapper</a>< TResult > </td>
<td class="paramname"><em>rowMapper</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialized the <a class="el" href="a00292.html#a9953489e703640c45bb03132183282c7" title="Initialized the CommandAccessor<TResult> with a database instance and a Row Mapper.">CommandAccessor<TResult></a> with a database instance and a Row Mapper. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">database</td><td>The <a class="el" href="a00428.html" title="Represents an abstract database that commands can be run against.">Database</a> used to execute the DbCommand.</td></tr>
<tr><td class="paramname">rowMapper</td><td>The IRowMapper<TResult> that will be used to convert the returned data to clr type <em>TResult</em> .</td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">ArgumentNullException</td><td><em>rowMapper</em> is <b>null</b>.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a96ea9d435d797e8a9e8c8540a1a23857"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96ea9d435d797e8a9e8c8540a1a23857">◆ </a></span>CommandAccessor() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.<a class="el" href="a00292.html">CommandAccessor</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00428.html">Database</a> </td>
<td class="paramname"><em>database</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00468.html">IResultSetMapper</a>< TResult > </td>
<td class="paramname"><em>resultSetMapper</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialized the <a class="el" href="a00292.html#a9953489e703640c45bb03132183282c7" title="Initialized the CommandAccessor<TResult> with a database instance and a Row Mapper.">CommandAccessor<TResult></a> with a database instance and a Row Mapper. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">database</td><td>The <a class="el" href="a00428.html" title="Represents an abstract database that commands can be run against.">Database</a> used to execute the DbCommand.</td></tr>
<tr><td class="paramname">resultSetMapper</td><td>The IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type <em>TResult</em> .</td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">ArgumentNullException</td><td><em>database</em> or <em>resultSetMapper</em> are <b>null</b>.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a4970e059d6d67ddd47d7c8766838b524"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4970e059d6d67ddd47d7c8766838b524">◆ </a></span>BeginExecute() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">abstract IAsyncResult <a class="el" href="a00424.html">Microsoft.Practices.EnterpriseLibrary.Data.DataAccessor</a>< TResult >.BeginExecute </td>
<td>(</td>
<td class="paramtype">AsyncCallback </td>
<td class="paramname"><em>callback</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">object </td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">params object[] </td>
<td class="paramname"><em>parameterValues</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Begin executing the database object asynchronously, returning a IAsyncResult object that can be used to retrieve the result set after the operation completes. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">callback</td><td>Callback to execute when the operation's results are available. May be null if you don't wish to use a callback.</td></tr>
<tr><td class="paramname">state</td><td>Extra information that will be passed to the callback. May be null.</td></tr>
<tr><td class="paramname">parameterValues</td><td>Parameters to pass to the database.</td></tr>
</table>
</dd>
</dl>
<p>This operation will throw if the underlying <a class="el" href="a00428.html" title="Represents an abstract database that commands can be run against.">Database</a> object does not support asynchronous operation.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">InvalidOperationException</td><td>The underlying database does not support asynchronous operation.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The IAsyncResult representing this operation.</dd></dl>
<p>Implemented in <a class="el" href="a00532.html#a224fa9ccfa5d5b8ff3dd848f641c13e6">Microsoft.Practices.EnterpriseLibrary.Data.SqlStringAccessor< TResult ></a>, and <a class="el" href="a00524.html#a5045e1cfce292ede2de83e80427819d3">Microsoft.Practices.EnterpriseLibrary.Data.SprocAccessor< TResult ></a>.</p>
</div>
</div>
<a id="a0f84abef7bf86eae0377e5aaf928d67f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f84abef7bf86eae0377e5aaf928d67f">◆ </a></span>BeginExecute() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">IAsyncResult <a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.BeginExecute </td>
<td>(</td>
<td class="paramtype">DbCommand </td>
<td class="paramname"><em>command</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00464.html">IParameterMapper</a> </td>
<td class="paramname"><em>parameterMapper</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AsyncCallback </td>
<td class="paramname"><em>callback</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">object </td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">object[] </td>
<td class="paramname"><em>parameterValues</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Helper method to kick off execution of an asynchronous database operation. This method handles the boilerplate of setting up the parameters and invoking the operation on the database with the right options. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">command</td><td>The DbCommand to execute.</td></tr>
<tr><td class="paramname">parameterMapper</td><td>The <a class="el" href="a00464.html" title="Interface used to interpret parameters passed to an DataAccessor<TResult>.Execute(object[]) method an...">IParameterMapper</a> to use to set the parameter values.</td></tr>
<tr><td class="paramname">callback</td><td>Callback to execute when the operation's result is available.</td></tr>
<tr><td class="paramname">state</td><td>State to pass to the callback.</td></tr>
<tr><td class="paramname">parameterValues</td><td>Input parameter values.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An IAsyncResult object representing the outstanding async request.</dd></dl>
</div>
</div>
<a id="a00c4dfe207766604466424e65f8ca51c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00c4dfe207766604466424e65f8ca51c">◆ </a></span>EndExecute()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">override IEnumerable<TResult> <a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.EndExecute </td>
<td>(</td>
<td class="paramtype">IAsyncResult </td>
<td class="paramname"><em>asyncResult</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Complete an operation started by <a class="el" href="a00424.html#a4970e059d6d67ddd47d7c8766838b524" title="Begin executing the database object asynchronously, returning a IAsyncResult object that can be used ...">DataAccessor<TResult>.BeginExecute</a>. </p>
<dl class="section return"><dt>Returns</dt><dd>The result sequence.</dd></dl>
<p>Implements <a class="el" href="a00424.html#aa816841757008880d8c8f4c04ac6fb32">Microsoft.Practices.EnterpriseLibrary.Data.DataAccessor< TResult ></a>.</p>
</div>
</div>
<a id="af7e06ccea7ae67c366467e6e6c7c1d1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7e06ccea7ae67c366467e6e6c7c1d1d">◆ </a></span>Execute() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">IEnumerable<TResult> <a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.Execute </td>
<td>(</td>
<td class="paramtype">DbCommand </td>
<td class="paramname"><em>command</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Executes the <em>command</em> and returns an enumerable of <em>TResult</em> . The enumerable returned by this method uses deferred loading to return the results. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">command</td><td>The command that will be executed.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An enumerable of <em>TResult</em> .</dd></dl>
</div>
</div>
<a id="a8b6d7d77c85f574e380a113e7c1f22c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b6d7d77c85f574e380a113e7c1f22c1">◆ </a></span>Execute() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">abstract IEnumerable<TResult> <a class="el" href="a00424.html">Microsoft.Practices.EnterpriseLibrary.Data.DataAccessor</a>< TResult >.Execute </td>
<td>(</td>
<td class="paramtype">params object[] </td>
<td class="paramname"><em>parameterValues</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Execute the database operation synchronously, returning the IEnumerable<TResult> sequence containing the resulting objects. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parameterValues</td><td>Parameters to pass to the database.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The sequence of result objects.</dd></dl>
<p>Implemented in <a class="el" href="a00532.html#abf8c38901664f6cb65fc1f349ae34c7d">Microsoft.Practices.EnterpriseLibrary.Data.SqlStringAccessor< TResult ></a>, and <a class="el" href="a00524.html#a1fac5b48184b00243b716c7467575b48">Microsoft.Practices.EnterpriseLibrary.Data.SprocAccessor< TResult ></a>.</p>
</div>
</div>
<a id="abbd4d072c1b9d993e47ceeff44c952dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbd4d072c1b9d993e47ceeff44c952dc">◆ </a></span>GuardAsyncAllowed()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.GuardAsyncAllowed </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if the current <a class="el" href="a00428.html" title="Represents an abstract database that commands can be run against.">Database</a> object supports asynchronous operations, and throws InvalidOperationException if not. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">InvalidOperationException</td><td>The database does not support asynchronous operations.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a id="a9e037b56538aa928482c69d4ff8044e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e037b56538aa928482c69d4ff8044e5">◆ </a></span>Database</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00428.html">Database</a> <a class="el" href="a00292.html">Microsoft.Practices.EnterpriseLibrary.Data.CommandAccessor</a>< TResult >.<a class="el" href="a00428.html">Database</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The database object this accessor is wrapped around. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>CommandAccessor.cs</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="a00230.html">Microsoft</a></li><li class="navelem"><a class="el" href="a00231.html">Practices</a></li><li class="navelem"><a class="el" href="a00232.html">EnterpriseLibrary</a></li><li class="navelem"><a class="el" href="a00233.html">Data</a></li><li class="navelem"><a class="el" href="a00292.html">CommandAccessor</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>