Maps a one to one association.

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 BelongsToAttribute : WithAccessAttribute

Remarks

Please note that the 'blogid' foreign key lies on the 'Post' table.

Examples

CopyC#
public class Post : ActiveRecordBase
{
        ...

        [BelongsTo("blogid")]
        public Blog Blog
        {
        get { return _blog; }
        set { _blog = value; }
        }

Inheritance Hierarchy

System..::Object
  System..::Attribute
    Castle.ActiveRecord..::WithAccessAttribute
      Castle.ActiveRecord..::BelongsToAttribute

See Also