Few name changes and expose AdditionalParameters in CreationContext.
[castle.git] / docs / ActiveRecordIntro.html
blob54a52fd58382c86ec8c05312908c7ef91b336436
1 <html><!-- InstanceBegin template="/Templates/template1.dwt.asp" codeOutsideHTMLIsLocked="false" -->
2 <head>
3 <!-- InstanceBeginEditable name="doctitle" --><title>ActiveRecord</title><!-- InstanceEndEditable -->
4 <link rel="stylesheet" type="text/css" href="styles/presentation.css" />
5 </head>
7 <body>
9 <div id="header">
10 <table id="topTable">
11 <tr id="headerTableRow1">
12 <td align="left">
13 <span id="runningHeaderText">Castle Project</span>
14 </td>
15 </tr>
16 <tr id="headerTableRow2">
17 <td align="left"><!-- InstanceBeginEditable name="Title" -->ActiveRecord<!-- InstanceEndEditable --></td>
18 </tr>
19 </table>
20 </div>
21 <div id="mainSection">
22 <div id="mainBody">
23 <h1 class="heading"><!-- InstanceBeginEditable name="MainHeading" -->Castle ActiveRecord<!-- InstanceEndEditable --></h1>
25 <!-- InstanceBeginEditable name="Content" -->
26 <!-- @SortOrder 3 -->
28 <p>
29 The Castle ActiveRecord project is an implementation of the ActiveRecord pattern for .NET. The ActiveRecord pattern
30 consists on instance properties representing a record in the database, instance methods acting on that specific record
31 and static methods acting on all records.
32 </p>
34 <p>
35 Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping free the developer of writing XML
36 for database-to-object mapping, which is needed when using NHibernate directly.
37 </p>
39 <pre lang="cs" numberLines="false" title="Example of ActiveRecord class">
40 [ActiveRecord]
41 public class Blog : ActiveRecordBase<Blog>
43 private int id;
44 private string name;
45 private string author;
47 [PrimaryKey]
48 public int Id
50 get { return id; }
51 set { id = value; }
54 [Property]
55 public string Name
57 get { return name; }
58 set { name = value; }
61 [Property]
62 public string Author
64 get { return author; }
65 set { author = value; }
68 </pre>
70 <p>
71 ActiveRecord resources:
72 </p>
74 <ul>
75 <li> <a href="http://www.castleproject.org/activerecord/gettingstarted/index.html" target="_blank">Getting Started</a> </li>
76 <li> <a href="http://www.castleproject.org/activerecord/documentation/index.html" target="_blank">Documentation</a> </li>
77 <li> <a href="http://www.castleproject.org/activerecord/recipes/index.html" target="_blank">Recipes</a> </li>
78 <li> <a href="http://www.castleproject.org/activerecord/roadmap.html" target="_blank">Roadmap</a> </li>
79 <li> <a href="http://www.castleproject.org/activerecord/faq.html" target="_blank">FAQ</a> </li>
80 </ul>
82 <!-- InstanceEndEditable --></div>
83 </div>
85 <div id="footer">
86 <div class="footerLine">
87 <img width="100%" height="3px" src="icons/footer.gif" alt="Footer image"/>
88 </div>
89 <div id="footer">
90 <include item="comments"/>
91 <include item="copyright"/>
92 </div>
93 </div>
94 </body>
95 <!-- InstanceEnd --></html>