KREDOR Business Object Framework Documentation

SelectFrom Class

Represents a SELECT query used to select business objects from the database.

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

System.Object
   SelectFrom

public class SelectFrom

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.

Example

This sample demonstrates various ways of using SelectFrom.

    // Load a collection of Person objects having first name 'John' and sorted by last name.
    ArrayList contacts = SelectFrom.From(typeof(Contact))
                                         .Where("FirstName", Op.Equals, "John")
                                         .OrderBy("LastName")
                                         .Select();
    // Get the last entered phonenumber for an account
    PhoneNumber p = (PhoneNumber)SelectFrom.From(typeof(PhoneNumber))
                                            .Where("CreateDate", Op.IsMax)
                                            .Where("AccountID", Op.Equals, this._accountID)
                                            .SelectOne();
    
    // Load an Account object by a primary key value
 int accountID = 7351
    Account account = SelectFrom.From(typeof(Account)).SelectByPrimaryKey(accountID);
 
 // Select all accounts in a specified state by using a JOIN.
  return SelectFrom.From(typeof(Account))
        .Join(SelectFrom.From(typeof(Address)).All.Where("State", Op.Equals, state))
        .On("AccountID", "AccountID")     
        .Select();
 
    // Select accounts by calling a stored procedure.  
 ArrayList accountsInCalifornia = SelectFrom.From(typeof(Account))
                                                .StoredProcedure("sp_GetAccountsWithOrders", "CA")
                                                .Select();    

 

Requirements

Namespace: Kredor.BO

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

See Also

SelectFrom Members | Kredor.BO Namespace | WhereCondition | OrderBy | Column