Maps properties of a child object to columns of the table
of a parent class.
Namespace: Castle.ActiveRecord
Assembly: Castle.ActiveRecord (in Castle.ActiveRecord.dll)
Version: 1.0.3.0
Syntax
| C# |
|---|
[SerializableAttribute] [AttributeUsageAttribute(AttributeTargets.Property, AllowMultiple = false)] public class NestedAttribute : WithAccessAttribute |
Examples
The following code illustrates the use of a
nested PostalAddress class
CopyC#
[ActiveRecord("Companies")] public class Company : ActiveRecordBase { private int id; private PostalAddress _address; public Company() { } public Company(string name) { this.name = name; } [PrimaryKey] public int Id { get { return id; } set { id = value; } } [Nested] public PostalAddress Address { get { return _address; } set { _address = value; } } } public class PostalAddress { private String _address; private String _city; private String _state; private String _zipcode; [Property] public String Address { get { return _address; } set { _address = value; } } [Property] public String City { get { return _city; } set { _city = value;} } [Property] public String State { get { return _state; } set { _state = value; } } [Property] public String ZipCode { get { return _zipcode; } set { _zipcode = value; } } } |
Inheritance Hierarchy
System..::Object
System..::Attribute
Castle.ActiveRecord..::WithAccessAttribute
Castle.ActiveRecord..::NestedAttribute
System..::Attribute
Castle.ActiveRecord..::WithAccessAttribute
Castle.ActiveRecord..::NestedAttribute
See Also
NestedAttribute Members
Castle.ActiveRecord Namespace