RelationalMemberInfoAttribute class

Defines various attributes for fields and properties of data objects persitable using ObjectFactory.

Namespace: ReFlex.Data namespace
Assembly: ReFlex.Data.dll

Syntax

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class RelationalMemberInfoAttribute : Attribute

Constructors

RelationalMemberInfoAttribute()

Remarks

Define on a per field or property basis where default ObjectFactory behaviour needs to be adjusted.

Examples

public class Contact
{   
    private int m_ContactID;
    private string m_FirstName;
    private string m_LastName;
    private int m_CompanyID;

    public int ContactID
    {
        get { return m_ContactID; }
        set { m_ContactID = value; }
    }
    public int FirstName
    {
        get { return m_FirstName; }
        set { m_FirstName= value; }
    }
    public int LastName
    {
        get { return m_LastName; }
        set { m_LastName= value; }
    }
    [RelationalMemberInfo(IsIntZeroConvertedToNull = true)]
    public int CompanyID
    {
        get { return m_CompanyID; }
        set { m_CompanyID= value; }
    }

    [RelationalMemberInfo(IsNotPersistable = true)]
    public string FullName
    {
        get { return FirstName + " " + LastName; }
    }
}