1 namespace Castle
.ActiveRecord
.Tests
.Model
.NestedValidation
3 using Castle
.Components
.Validator
;
6 public class UserWithNestedAddress
: ActiveRecordValidationBase
<UserWithNestedAddress
>
10 private Address postalAddress
= new Address();
11 private Address billingAddress
;
13 [PrimaryKey(PrimaryKeyType
.Native
)]
21 [ValidateNonEmpty
, ValidateLength(5, 5)]
25 set { email = value; }
29 public Address PostalAddress
31 get { return postalAddress; }
32 set { postalAddress = value; }
36 public Address BillingAddress
{
37 get { return billingAddress; }
38 set { billingAddress = value; }
43 public class UserWithNestedAddressNonGeneric
: ActiveRecordValidationBase
47 private Address postalAddress
= new Address();
48 private Address billingAddress
;
50 [PrimaryKey(PrimaryKeyType
.Native
)]
57 [ValidateNonEmpty
, ValidateLength(5, 5)]
60 set { email = value; }
64 public Address PostalAddress
{
65 get { return postalAddress; }
66 set { postalAddress = value; }
70 public Address BillingAddress
{
71 get { return billingAddress; }
72 set { billingAddress = value; }
78 private string addressLine1
;
79 private string country
;
82 [ValidateNonEmpty
, ValidateLength(5,5)]
83 public string AddressLine1
85 get { return addressLine1; }
86 set { addressLine1 = value; }
93 get { return country;}
94 set { country = value; }