2 using System
.Collections
;
3 using Castle
.ActiveRecord
;
5 namespace <%= Namespace
%>
8 /// An instance of this class represents a <%= Name %>.
11 public class <%= ClassName
%> : ActiveRecordValidationBase
<% if UseGeneric
: %><%= "<" + ClassName
+ ">" %><% end
%>
15 <% for field
in Fields
: %>
16 private string _
<%= field
.ToLower() %>;
20 #region Persistent properties
26 <% i
=0; for prop
in Properties
: %>
28 public string <%= prop
%> {
29 get { return _<%= Fields[i] %>; }
30 set { _<%= Fields[i++] %> = value; }
35 <% if not UseGeneric
: %>
37 public static <%= ClassName
%>[] FindAll()
39 return ((<%= ClassName
%>[]) (ActiveRecordBase
.FindAll(typeof(<%= ClassName
%>))));
42 public static <%= ClassName
%> Find(int id
)
44 return ((<%= ClassName
%>) (ActiveRecordBase
.FindByPrimaryKey(typeof(<%= ClassName
%>), id
)));