1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
.GenericModel
19 [ActiveRecord( "Employee" )]
20 public class Employee
: ActiveRecordBase
<Employee
>
23 private string firstName
;
24 private string lastName
;
27 [PrimaryKey( PrimaryKeyType
.Native
, "EmployeeID" )]
30 get { return this.id; }
31 set { this.id = value; }
35 public string FirstName
37 get { return this.firstName; }
38 set { this.firstName = value; }
42 public string LastName
44 get { return this.lastName; }
45 set { this.lastName = value; }
51 get { return this.award; }
52 set { this.award = value; }
58 [ActiveRecord( "Award" )]
59 public class Award
: ActiveRecordBase
<Award
>
61 private Employee employee
;
62 private string description
;
69 public Award( Employee employee
)
71 this.employee
= employee
;
75 public Employee Employee
77 get { return this.employee; }
78 set { this.employee = value; }
81 [PrimaryKey( PrimaryKeyType
.Foreign
, "EmployeeID" )]
84 get { return this.id; }
85 set { this.id = value; }
89 public string Description
91 get { return this.description; }
92 set { this.description = value; }