KREDOR Business Object Framework Documentation

FromAttribute Class

Specifies the type of object to be loaded into an ArrayList field (joined field).

For a list of all members of this type, see FromAttribute Members.

System.Object
   Attribute
      FromAttribute

public class FromAttribute : Attribute

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

All joined fields must be decorated with the OnAttribute. FromAttribute is not needed if the field is of a generic type such as List<T>. Joined fields must be of one of the following types: a type derived directly or indirectly from BusinessObject or a type that implements the IList interface such ArrayList or List<T>;.

Example

This sample shows a class where the second joined field is decorated with the FromAttribute specifying that the ArrayList field value is to be loaded with Subscription instances. For this example 'Subscription' is business class derived from BusinessObject.

[DataSource("MyDatabase")]
public class Account : BusinessObject
{
    private int _accountID;
    private string _name;
    private int _status;
    private DateTime _createDate;

    [On("accountid")]
    public Person _owner;

    [From(typeof(Subscription))]
    [On("accountid", "account_id")]
    [Where("Status", Op.Equals, SubscriptionStatus.Active)]
    public ArrayList _activeSubscriptions;
    
    public Account() : base ()
    {
    }

    protected override void OnLoad()
    {
    }
}

Requirements

Namespace: Kredor.BO

Assembly: KREDOR.BOFramework (in KREDOR.BOFramework.dll)

See Also

FromAttribute Members | Kredor.BO Namespace | OnAttribute | FromAttribute | SelectFrom