Added RedirectUsingNamedRoute
[castle.git] / ActiveRecord / Castle.ActiveRecord.Tests / Model / Nested / WithPrefix.cs
blob8892e720d30e6692b0c04a5958dcd2da14194b93
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.ActiveRecord.Tests.Model.Nested
17 using System;
19 [ActiveRecord]
20 public class NestedWithPrefix : ActiveRecordBase
22 private int id;
23 private Name self, other;
25 [PrimaryKey(PrimaryKeyType.Native)]
26 public int Id
28 get { return this.id; }
29 set { this.id = value; }
32 [Nested]
33 public Name Self
35 get { return this.self; }
36 set { this.self = value; }
39 [Nested(ColumnPrefix = "othername_")]
40 public Name Other
42 get { return this.other; }
43 set { this.other = value; }
46 #region Public Operations
48 public static void DeleteAll()
50 DeleteAll(typeof(NestedWithPrefix));
53 public static NestedWithPrefix[] FindAll()
55 return (NestedWithPrefix[]) FindAll(typeof(NestedWithPrefix));
58 public static NestedWithPrefix Find(int id)
60 return (NestedWithPrefix) FindByPrimaryKey(typeof(NestedWithPrefix), id);
63 #endregion
66 public class Name
68 private String first, last;
70 [Property]
71 public string First
73 get { return this.first; }
74 set { this.first = value; }
77 [Property("last")]
78 public string Last
80 get { return this.last; }
81 set { this.last = value; }
84 [Field]
85 public string Middle;