diff Tools/DocGen/Content/Doc/DataAccess/AbstractAccessor.htm @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools/DocGen/Content/Doc/DataAccess/AbstractAccessor.htm	Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,37 @@
+<% group # Abstract accessors %>
+<% order # 20 %>
+
+<p class="j">The following example demonstrates how to create and use an abstract data accessor class.
+All abstract methods of the class are generated at run-time depending on each method declaration.
+Every part of the method declaration is important.
+Method's return value specifies one of the Execute methods in the following way:
+<table class='data'>
+<tr><th>Return Type</th><th>Execute Method</th></tr>
+<tr><td><i>IDataReader</i> interface</td><td>ExecuteReader</td></tr>
+<tr><td>Subclass of <i>DataSet</i></td><td>ExecuteDataSet</td></tr>
+<tr><td>Subclass of <i>DataTable</i></td><td>ExecuteDataTable</td></tr>
+<tr><td>Class implementing the <i>IList</i> interface</td><td><a href="ExecuteList.htm">ExecuteList</a> or <a href="ExecuteList.htm">ExecuteScalarList</a></td></tr>
+<tr><td>Class implementing the <i>IDictionary</i> interface</td><td><a href="ExecuteDictionary.htm">ExecuteDictionary</a> or <a href="ExecuteDictionary.htm">ExecuteScalarDictionary</a></td></tr>
+<tr><td><i>void</i></td><td>ExecuteNonQuery</td></tr>
+<tr><td><i>string</i>, <i>byte[]</i> or value type</td><td><a href="ExecuteScalar.htm">ExecuteScalar</a></td></tr>
+<tr><td>In any other case</td><td><a href="ExecuteObject.htm">ExecuteObject</a></td></tr>
+</table>
+Method name explicitly defines action name which is converted to stored procedure name.<br/>
+Type, sequential order, and name of the method parameters is mapped to the command parameters.
+Exceptions from this rule are:
+<br>
+<div style="margin:-10px 0px -10px -10px"><ul compact="compact">
+<li>a parameter of <a href="../Data/index.htm"><i>DbManager</i></a> type. In this case generator uses provided <a href="../Data/index.htm"><i>DbManager</i></a> to call the command.</li>
+<li>parameters decorated with attribute <i>FormatAttribute</i>.</li>
+</ul></div>
+</p>
+AbstractAccessor.cs
+<% ..\..\..\HowTo\DataAccess\AbstractAccessor.cs %>
+<a name='Person'></a>
+Person.cs
+<% ..\..\..\HowTo\DataAccess\Person.cs %>
+Gender.cs
+<% ..\..\..\HowTo\DataAccess\Gender.cs %>
+App.config
+<% Doc\Data\App.config %>
+<a href="../Data/CreateSql.htm">Create.sql script</a>