CSLA

CSLA .NET

CSLA Namespace

Namespace hierarchy

Classes

Class | Description
BrokenRules | Tracks the business rules broken within a business object.
BrokenRules.DescriptionAttribute | Defines the description of a business rule.
BrokenRules.RuleArgs | Object providing extra information to methods that implement business rules.
BrokenRules.RulesCollection | A collection of currently broken rules.
BusinessBase | This is the base class from which most business objects will be derived.
BusinessCollectionBase | This is the base class from which most business collection objects will be derived.
BusinessCollectionBase.DeletedCollection | Defines a strongly-typed collection to store all child objects marked for deletion.
CriteriaBase | Base type from which Criteria classes can be derived in a business class.
DataPortal | This is the client-side DataPortal as described in Chapter 5.
NameValueList | This is a base class from which readonly name/value business classes can be quickly and easily created.
NotUndoableAttribute | Allows us to mark fields that should not be copied as part of the undo process
ReadOnlyBase | This is a base class from which readonly business classes can be derived.
ReadOnlyCollectionBase | This is the base class from which readonly collections of readonly objects should be derived.
RunLocalAttribute | Allows us to mark DataPortal_xxx methods to be run on the client even if the server-side DataPortal is configured for remote use.
SmartDate | Provides a date data type that understands the concept of an empty date value.
TransactionalAttribute | Allows us to mark the DataPortal_xxx methods in our business classes as transactional.
ValidationException | Exception class indicating that there was a validation problem with a business object.

Structures

Structure | Description
BrokenRules.Rule | Stores details about a specific broken business rule.

Delegates

Delegate | Description
BrokenRules.RuleHandler | Delegate that defines the method signature for all rule handler methods.

Copyright 2003 Rockford Lhotka. All rights reserved.


BrokenRules Class

Tracks the business rules broken within a business object.

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

System.Object
BrokenRules

[Visual Basic]
Public Class BrokenRules
[C#]
public class BrokenRules

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BrokenRules Members | CSLA Namespace


BrokenRules Members

Public Instance Constructors

BrokenRules Constructor Initializes a new instance of the BrokenRules class.

Public Instance Properties

IsValid Returns a value indicating whether there are any broken rules at this time. If there are broken rules, the business object is assumed to be invalid and False is returned. If there are no broken business rules True is returned.

Public Instance Methods

AddRule | Overloaded. Adds a rule to the list of rules to be enforced.
Assert | Overloaded. This method is called by business logic within a business class to indicate whether a business rule is broken.
CheckRules | Overloaded. Checks all the rules for a specific ruleName.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBrokenRules | Returns a reference to the readonly collection of broken business rules.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsBroken | Returns a value indicating whether a particular business rule is currently broken.
SetTargetObject | Sets the target object so the Rules Manager functionality has a reference to the object containing the data to be validated.
ToString | Returns the text of all broken rule descriptions, each separated by cr/lf.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BrokenRules Class | CSLA Namespace


BrokenRules Constructor

Initializes a new instance of the BrokenRules class.

[Visual Basic]
Public Sub New()
[C#]
public BrokenRules();

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules Properties

The properties of the BrokenRules class are listed below. For a complete list of BrokenRules class members, see the BrokenRules Members topic.

Public Instance Properties

IsValid Returns a value indicating whether there are any broken rules at this time. If there are broken rules, the business object is assumed to be invalid and False is returned. If there are no broken business rules True is returned.

See Also

BrokenRules Class | CSLA Namespace


BrokenRules.IsValid Property

Returns a value indicating whether there are any broken rules at this time. If there are broken rules, the business object is assumed to be invalid and False is returned. If there are no broken business rules True is returned.

[Visual Basic]
Public ReadOnly Property IsValid As Boolean
[C#]
public bool IsValid {get;}

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules Methods

The methods of the BrokenRules class are listed below. For a complete list of BrokenRules class members, see the BrokenRules Members topic.

Public Instance Methods

AddRule | Overloaded. Adds a rule to the list of rules to be enforced.
Assert | Overloaded. This method is called by business logic within a business class to indicate whether a business rule is broken.
CheckRules | Overloaded. Checks all the rules for a specific ruleName.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBrokenRules | Returns a reference to the readonly collection of broken business rules.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsBroken | Returns a value indicating whether a particular business rule is currently broken.
SetTargetObject | Sets the target object so the Rules Manager functionality has a reference to the object containing the data to be validated.
ToString | Returns the text of all broken rule descriptions, each separated by cr/lf.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BrokenRules Class | CSLA Namespace


AddRule Method

CSLA .NET

BrokenRules.AddRule Method

Adds a rule to the list of rules to be enforced.

Overload List

Adds a rule to the list of rules to be enforced.

public void AddRule(RuleHandler,string);

Adds a rule to the list of rules to be enforced.

public void AddRule(RuleHandler,string,RuleArgs);

Adds a rule to the list of rules to be enforced.

public void AddRule(RuleHandler,string,string);

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.AddRule Method (RuleHandler, String)

Adds a rule to the list of rules to be enforced.

[Visual Basic]
Overloads Public Sub AddRule( _
   ByVal handler As RuleHandler, _
   ByVal ruleName As String _
)
[C#]
public void AddRule(
RuleHandler handler,
string ruleName
);

Parameters

handler
The method that implements the rule.
ruleName
A user-friendly identifier for the field/property to which the rule applies.

Remarks

A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate.

The ruleName is used to group all the rules that apply to a specific field, property or concept. All rules applying to the field or property should have the same rule name. When rules are checked, they can be checked globally or for a specific ruleName.

The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.AddRule Overload List


BrokenRules.AddRule Method (RuleHandler, String, RuleArgs)

Adds a rule to the list of rules to be enforced.

[Visual Basic]
Overloads Public Sub AddRule( _
   ByVal handler As RuleHandler, _
   ByVal ruleName As String, _
   ByVal ruleArgs As RuleArgs _
)
[C#]
public void AddRule(
RuleHandler handler,
string ruleName,
RuleArgs ruleArgs
);

Parameters

handler
The method that implements the rule.
ruleName
A user-friendly identifier for the field/property to which the rule applies.
ruleArgs
A RuleArgs object containing data to be passed to the method implementing the rule.

Remarks

A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate.

The ruleName is used to group all the rules that apply to a specific field, property or concept. All rules applying to the field or property should have the same rule name. When rules are checked, they can be checked globally or for a specific ruleName.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.AddRule Overload List


BrokenRules.AddRule Method (RuleHandler, String, String)

Adds a rule to the list of rules to be enforced.

[Visual Basic]
Overloads Public Sub AddRule( _
   ByVal handler As RuleHandler, _
   ByVal ruleName As String, _
   ByVal propertyName As String _
)
[C#]
public void AddRule(
RuleHandler handler,
string ruleName,
string propertyName
);

Parameters

handler
The method that implements the rule.
ruleName
A user-friendly identifier for the field/property to which the rule applies.
propertyName
The property name on the target object where the rule implementation can retrieve the value to be validated.

Remarks

A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate.

The ruleName is used to group all the rules that apply to a specific field, property or concept. All rules applying to the field or property should have the same rule name. When rules are checked, they can be checked globally or for a specific ruleName.

The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.AddRule Overload List


Assert Method

CSLA .NET

BrokenRules.Assert Method

This method is called by business logic within a business class to indicate whether a business rule is broken.

Overload List

This method is called by business logic within a business class to indicate whether a business rule is broken.

public void Assert(string,string,bool);

This method is called by business logic within a business class to indicate whether a business rule is broken.

public void Assert(string,string,string,bool);

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.Assert Method (String, String, Boolean)

This method is called by business logic within a business class to indicate whether a business rule is broken.

[Visual Basic]
Overloads Public Sub Assert( _
   ByVal Rule As String, _
   ByVal Description As String, _
   ByVal IsBroken As Boolean _
)
[C#]
public void Assert(
string Rule,
string Description,
bool IsBroken
);

Parameters

Rule
The name of the business rule.
Description
The description of the business rule.
IsBroken
True if the value is broken, False if it is not broken.

Remarks

Rules are identified by their names. The description field is merely a comment that is used for display to the end user. When a rule is marked as broken, it is recorded under the rule name value. To mark the rule as not broken, the same rule name must be used.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.Assert Overload List


BrokenRules.Assert Method (String, String, String, Boolean)

This method is called by business logic within a business class to indicate whether a business rule is broken.

[Visual Basic]
Overloads Public Sub Assert( _
   ByVal Rule As String, _
   ByVal Description As String, _
   ByVal Property As String, _
   ByVal IsBroken As Boolean _
)
[C#]
public void Assert(
string Rule,
string Description,
string Property,
bool IsBroken
);

Parameters

Rule
The name of the business rule.
Description
The description of the business rule.
Property
The property affected by the business rule.
IsBroken
True if the value is broken, False if it is not broken.

Remarks

Rules are identified by their names. The description field is merely a comment that is used for display to the end user. When a rule is marked as broken, it is recorded under the rule name value. To mark the rule as not broken, the same rule name must be used.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.Assert Overload List


CheckRules Method

CSLA .NET

BrokenRules.CheckRules Method

Checks all the rules for a target object.

Overload List

Checks all the rules for a specific ruleName.

public void CheckRules(string);

Checks all the rules for a target object.

public void CheckRules();

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.CheckRules Method ()

Checks all the rules for a target object.

[Visual Basic]
Overloads Public Sub CheckRules()
[C#]
public void CheckRules();

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.CheckRules Overload List


BrokenRules.CheckRules Method (String)

Checks all the rules for a specific ruleName.

[Visual Basic]
Overloads Public Sub CheckRules( _
   ByVal ruleName As String _
)
[C#]
public void CheckRules(
string ruleName
);

Parameters

ruleName
The ruleName to be validated.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace | BrokenRules.CheckRules Overload List


BrokenRules.GetBrokenRules Method

Returns a reference to the readonly collection of broken business rules.

[Visual Basic]
Public Function GetBrokenRules() As RulesCollection
[C#]
public RulesCollection GetBrokenRules();

Return Value

A reference to the collection of broken rules.

Remarks

The reference returned points to the actual collection object. This means that as rules are marked broken or unbroken over time, the underlying data will change. Because of this, the UI developer can bind a display directly to this collection to get a dynamic display of the broken rules at all times.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.IsBroken Method

Returns a value indicating whether a particular business rule is currently broken.

[Visual Basic]
Public Function IsBroken( _
   ByVal Rule As String _
) As Boolean
[C#]
public bool IsBroken(
string Rule
);

Parameters

Rule
The name of the rule to check.

Return Value

A value indicating whether the rule is currently broken.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.SetTargetObject Method

Sets the target object so the Rules Manager functionality has a reference to the object containing the data to be validated.

[Visual Basic]
Public Sub SetTargetObject( _
   ByVal target As Object _
)
[C#]
public void SetTargetObject(
object target
);

Parameters

target
A reference to the object containing the data to be validated.

Remarks

The object here is typically your business object. In your business class you'll implement a method to set up your business rules. As you do so, you need to call this method to give BrokenRules a reference to your business object so it has access to your object's data.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.ToString Method

Returns the text of all broken rule descriptions, each separated by cr/lf.

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

Return Value

The text of all broken rule descriptions.

See Also

BrokenRules Class | BrokenRules Members | CSLA Namespace


BrokenRules.DescriptionAttribute Class

Defines the description of a business rule.

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

System.Object
Attribute
BrokenRules.DescriptionAttribute

[Visual Basic]
Public Class BrokenRules.DescriptionAttribute
Inherits Attribute
[C#]
public class BrokenRules.DescriptionAttribute : Attribute

Remarks

The description in this attribute is used by BusinessRules as information that is provided to the UI or other consumer about which rules are broken. These descriptions are intended for end-user display.

The description value is a .NET format string, and it can include the following tokens in addition to literal text:

{0} - the RuleName value

{1} - the PropertyName value

{2} - the full type name of the target object

{3} - the ToString value of the target object

You can use these tokens in your description string and the appropriate values will be substituted for the tokens at runtime.

Instead of using this attribute, a rule handler method can set the Description property of the RuleArgs parameter to a description string. That approach can provide a more dynamic way to generate descriptions of broken rules.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BrokenRules.DescriptionAttribute Members | CSLA Namespace


BrokenRules.DescriptionAttribute Members

Public Instance Constructors

BrokenRules.DescriptionAttribute Constructor Initializes the attribute with a description.

Public Instance Properties

TypeId (inherited from Attribute) When implemented in a derived class, gets a unique identifier for this Attribute.

Public Instance Methods

Equals (inherited from Attribute) |
GetHashCode (inherited from Attribute) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IsDefaultAttribute (inherited from Attribute) | When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
Match (inherited from Attribute) | When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
ToString | Returns the description value of the attribute.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BrokenRules.DescriptionAttribute Class | CSLA Namespace


BrokenRules.DescriptionAttribute Constructor

Initializes the attribute with a description.

[Visual Basic]
Public Sub New( _
   ByVal description As String _
)
[C#]
public BrokenRules.DescriptionAttribute(
string description
);

See Also

BrokenRules.DescriptionAttribute Class | BrokenRules.DescriptionAttribute Members | CSLA Namespace


BrokenRules.DescriptionAttribute Methods

The methods of the BrokenRules.DescriptionAttribute class are listed below. For a complete list of BrokenRules.DescriptionAttribute class members, see the BrokenRules.DescriptionAttribute Members topic.

Public Instance Methods

Equals (inherited from Attribute) |
GetHashCode (inherited from Attribute) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IsDefaultAttribute (inherited from Attribute) | When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
Match (inherited from Attribute) | When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
ToString | Returns the description value of the attribute.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BrokenRules.DescriptionAttribute Class | CSLA Namespace


BrokenRules.DescriptionAttribute.ToString Method

Returns the description value of the attribute.

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

See Also

BrokenRules.DescriptionAttribute Class | BrokenRules.DescriptionAttribute Members | CSLA Namespace


BrokenRules.Rule Structure

Stores details about a specific broken business rule.

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

System.Object
ValueType
BrokenRules.Rule

[Visual Basic]
Public Structure BrokenRules.Rule
[C#]
public struct BrokenRules.Rule

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BrokenRules.Rule Members | CSLA Namespace


BrokenRules.Rule Members

Public Instance Properties

Description | Provides access to the description of the broken rule.
Property | Provides access to the property affected by the broken rule.
Rule | Provides access to the name of the broken rule.

Public Instance Methods

Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BrokenRules.Rule Class | CSLA Namespace


BrokenRules.Rule Properties

The properties of the BrokenRules.Rule structure are listed below. For a complete list of BrokenRules.Rule structure members, see the BrokenRules.Rule Members topic.

Public Instance Properties

Description | Provides access to the description of the broken rule.
Property | Provides access to the property affected by the broken rule.
Rule | Provides access to the name of the broken rule.

See Also

BrokenRules.Rule Class | CSLA Namespace


BrokenRules.Rule.Description Property

Provides access to the description of the broken rule.

[Visual Basic]
Public Property Description As String
[C#]
public string Description {get; set;}

Property Value

The description of the rule.

Remarks

This value is actually readonly, not readwrite. Any new value set into this property is ignored. The property is only readwrite because that is required to support data binding within Web Forms.

See Also

BrokenRules.Rule Class | BrokenRules.Rule Members | CSLA Namespace


BrokenRules.Rule.Property Property

Provides access to the property affected by the broken rule.

[Visual Basic]
Public Property Property As String
[C#]
public string Property {get; set;}

Property Value

The property affected by the rule.

Remarks

This value is actually readonly, not readwrite. Any new value set into this property is ignored. The property is only readwrite because that is required to support data binding within Web Forms.

See Also

BrokenRules.Rule Class | BrokenRules.Rule Members | CSLA Namespace


BrokenRules.Rule.Rule Property

Provides access to the name of the broken rule.

[Visual Basic]
Public Property Rule As String
[C#]
public string Rule {get; set;}

Property Value

The name of the rule.

Remarks

This value is actually readonly, not readwrite. Any new value set into this property is ignored. The property is only readwrite because that is required to support data binding within Web Forms.

See Also

BrokenRules.Rule Class | BrokenRules.Rule Members | CSLA Namespace


BrokenRules.RuleArgs Class

Object providing extra information to methods that implement business rules.

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

System.Object
BrokenRules.RuleArgs

[Visual Basic]
Public Class BrokenRules.RuleArgs
[C#]
public class BrokenRules.RuleArgs

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BrokenRules.RuleArgs Members | CSLA Namespace


BrokenRules.RuleArgs Members

Public Static (Shared) Properties

Empty Returns an empty RuleArgs object.

Public Instance Constructors

BrokenRules.RuleArgs Overloaded. Initialize a new instance of the BrokenRules.RuleArgs class.

Public Instance Properties

Description | Set by the rule handler method to describe the broken rule.
PropertyName | The (optional) name of the property to be validated.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BrokenRules.RuleArgs Class | CSLA Namespace


BrokenRules.RuleArgs Constructor

Creates an instance of RuleArgs.

Overload List

Creates an instance of RuleArgs.

public BrokenRules.RuleArgs();

Creates an instance of RuleArgs.

public BrokenRules.RuleArgs(string);

See Also

BrokenRules.RuleArgs Class | BrokenRules.RuleArgs Members | CSLA Namespace


BrokenRules.RuleArgs Constructor ()

Creates an instance of RuleArgs.

[Visual Basic]
Overloads Public Sub New()
[C#]
public BrokenRules.RuleArgs();

See Also

BrokenRules.RuleArgs Class | BrokenRules.RuleArgs Members | CSLA Namespace | BrokenRules.RuleArgs Constructor Overload List


BrokenRules.RuleArgs Constructor (String)

Creates an instance of RuleArgs.

[Visual Basic]
Overloads Public Sub New( _
   ByVal propertyName As String _
)
[C#]
public BrokenRules.RuleArgs(
string propertyName
);

Parameters

propertyName
The name of the property to be validated.

See Also

BrokenRules.RuleArgs Class | BrokenRules.RuleArgs Members | CSLA Namespace | BrokenRules.RuleArgs Constructor Overload List


BrokenRules.RuleArgs Properties

The properties of the BrokenRules.RuleArgs class are listed below. For a complete list of BrokenRules.RuleArgs class members, see the BrokenRules.RuleArgs Members topic.

Public Static (Shared) Properties

Empty Returns an empty RuleArgs object.

Public Instance Properties

Description | Set by the rule handler method to describe the broken rule.
PropertyName | The (optional) name of the property to be validated.

See Also

BrokenRules.RuleArgs Class | CSLA Namespace


BrokenRules.RuleArgs.Description Property

Set by the rule handler method to describe the broken rule.

[Visual Basic]
Public Property Description As String
[C#]
public string Description {get; set;}

Remarks

If the rule handler sets this property, this value will override any description attribute value associated with the rule handler method.

The description string returned via this property is provided to the UI or other consumer about which rules are broken. These descriptions are intended for end-user display.

The description value is a .NET format string, and it can include the following tokens in addition to literal text:

{0} - the RuleName value

{1} - the PropertyName value

{2} - the full type name of the target object

{3} - the ToString value of the target object

You can use these tokens in your description string and the appropriate values will be substituted for the tokens at runtime.

See Also

BrokenRules.RuleArgs Class | BrokenRules.RuleArgs Members | CSLA Namespace


BrokenRules.RuleArgs.Empty Property

Returns an empty RuleArgs object.

[Visual Basic]
Public Shared ReadOnly Property Empty As RuleArgs
[C#]
public static BrokenRules.RuleArgs Empty {get;}

See Also

BrokenRules.RuleArgs Class | BrokenRules.RuleArgs Members | CSLA Namespace


BrokenRules.RuleArgs.PropertyName Property

The (optional) name of the property to be validated.

[Visual Basic]
Public ReadOnly Property PropertyName As String
[C#]
public string PropertyName {get;}

See Also

BrokenRules.RuleArgs Class | BrokenRules.RuleArgs Members | CSLA Namespace


BrokenRules.RuleHandler Delegate

Delegate that defines the method signature for all rule handler methods.

[Visual Basic]
Public Delegate Function BrokenRules.RuleHandler( _
ByVal target As Object, _
ByVal e As RuleArgs _
) As Boolean
[C#]
public delegate bool BrokenRules.RuleHandler(
object target,
RuleArgs e
);

Remarks

When implementing a rule handler, you must conform to the method signature defined by this delegate. You should also apply the Description attribute to your method to provide a meaningful description for your rule.

The method implementing the rule must return True if the data is valid and return False if the data is invalid.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

CSLA Namespace


BrokenRules.RulesCollection Class

A collection of currently broken rules.

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

System.Object
CollectionBase
BindableCollectionBase
BrokenRules.RulesCollection

[Visual Basic]
Public Class BrokenRules.RulesCollection
Inherits BindableCollectionBase
[C#]
public class BrokenRules.RulesCollection : BindableCollectionBase

Remarks

This collection is readonly and can be safely made available to code outside the business object such as the UI. This allows external code, such as a UI, to display the list of broken rules to the user.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BrokenRules.RulesCollection Members | CSLA Namespace


BrokenRules.RulesCollection Members

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
Item | Returns a BrokenRules.Rule object containing details about a specific broken business rule.
RuleForProperty | Returns the first BrokenRules.Rule object corresponding to the specified property.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ListChanged (inherited from BindableCollectionBase) Declares a serialization-safe ListChanged event.

Protected Instance Fields

AllowEdit (inherited from BindableCollectionBase) | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind (inherited from BindableCollectionBase) | Set this to True to allow this collection to be searched.
AllowNew (inherited from BindableCollectionBase) | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove (inherited from BindableCollectionBase) | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort (inherited from BindableCollectionBase) | Set this to True to allow this collection to be sorted.

Protected Instance Properties

IBindingList_IsSorted (inherited from BindableCollectionBase) | Override this method to indicate whether your collection is currently sorted. This returns False by default.
IBindingList_SortDirection (inherited from BindableCollectionBase) | Override this method to return the current sort direction (if you implement sorting).
IBindingList_SortProperty (inherited from BindableCollectionBase) | Override this method to return the property by which the collection is sorted (if you implement sorting).
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort (inherited from BindableCollectionBase) | Override this method to provide sorting functionality (if you implement sorting).
IBindingList_Find (inherited from BindableCollectionBase) | Override this method to implement search/find functionality for the collection.
IBindingList_RemoveSort (inherited from BindableCollectionBase) | Override this method to remove any existing sort (if you implement sorting).
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear | Prevents clearing the collection.
OnClearComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when the list is cleared.
OnInsert | Prevents insertion of items into the collection.
OnInsertComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when a new child is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove | Prevents removal of items from the collection.
OnRemoveComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is removed.
OnSet | Prevents changing items in the collection.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BrokenRules.RulesCollection Class | CSLA Namespace


BrokenRules.RulesCollection Properties

The properties of the BrokenRules.RulesCollection class are listed below. For a complete list of BrokenRules.RulesCollection class members, see the BrokenRules.RulesCollection Members topic.

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
Item | Returns a BrokenRules.Rule object containing details about a specific broken business rule.
RuleForProperty | Returns the first BrokenRules.Rule object corresponding to the specified property.

Protected Instance Properties

IBindingList_IsSorted (inherited from BindableCollectionBase) | Override this method to indicate whether your collection is currently sorted. This returns False by default.
IBindingList_SortDirection (inherited from BindableCollectionBase) | Override this method to return the current sort direction (if you implement sorting).
IBindingList_SortProperty (inherited from BindableCollectionBase) | Override this method to return the property by which the collection is sorted (if you implement sorting).
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

See Also

BrokenRules.RulesCollection Class | CSLA Namespace


BrokenRules.RulesCollection.Item Property

Returns a BrokenRules.Rule object containing details about a specific broken business rule.

[Visual Basic]
Public Default ReadOnly Property Item( _
ByVal Index As Integer _
) As Rule
[C#]
public BrokenRules.Rule this[
int Index
] {get;}

Parameters

Index

See Also

BrokenRules.RulesCollection Class | BrokenRules.RulesCollection Members | CSLA Namespace


BrokenRules.RulesCollection.RuleForProperty Property

Returns the first BrokenRules.Rule object corresponding to the specified property.

[Visual Basic]
Public Default ReadOnly Property RuleForProperty( _
ByVal Property As String _
) As Rule
[C#]
public BrokenRules.Rule this[
string Property
] {get;}

Parameters

Property
The name of the property affected by the rule.

Remarks

When a rule is marked as broken, the business developer can provide an optional Property parameter. This parameter is the name of the Property on the object that is most affected by the rule. Data binding may later use the IDataErrorInfo interface to query the object for details about errors corresponding to specific properties, and this value will be returned as a result of that query.

Code in a business object or UI can also use this value to retrieve the first broken rule in BrokenRules that corresponds to a specfic Property on the object.

See Also

BrokenRules.RulesCollection Class | BrokenRules.RulesCollection Members | CSLA Namespace


BrokenRules.RulesCollection Methods

The methods of the BrokenRules.RulesCollection class are listed below. For a complete list of BrokenRules.RulesCollection class members, see the BrokenRules.RulesCollection Members topic.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort (inherited from BindableCollectionBase) | Override this method to provide sorting functionality (if you implement sorting).
IBindingList_Find (inherited from BindableCollectionBase) | Override this method to implement search/find functionality for the collection.
IBindingList_RemoveSort (inherited from BindableCollectionBase) | Override this method to remove any existing sort (if you implement sorting).
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear | Prevents clearing the collection.
OnClearComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when the list is cleared.
OnInsert | Prevents insertion of items into the collection.
OnInsertComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when a new child is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove | Prevents removal of items from the collection.
OnRemoveComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is removed.
OnSet | Prevents changing items in the collection.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BrokenRules.RulesCollection Class | CSLA Namespace


BrokenRules.RulesCollection.OnClear Method

Prevents clearing the collection.

[Visual Basic]
Overrides Protected Sub OnClear()
[C#]
protected override void OnClear();

See Also

BrokenRules.RulesCollection Class | BrokenRules.RulesCollection Members | CSLA Namespace


BrokenRules.RulesCollection.OnInsert Method

Prevents insertion of items into the collection.

[Visual Basic]
Overrides Protected Sub OnInsert( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnInsert(
int index,
object value
);

See Also

BrokenRules.RulesCollection Class | BrokenRules.RulesCollection Members | CSLA Namespace


BrokenRules.RulesCollection.OnRemove Method

Prevents removal of items from the collection.

[Visual Basic]
Overrides Protected Sub OnRemove( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnRemove(
int index,
object value
);

See Also

BrokenRules.RulesCollection Class | BrokenRules.RulesCollection Members | CSLA Namespace


BrokenRules.RulesCollection.OnSet Method

Prevents changing items in the collection.

[Visual Basic]
Overrides Protected Sub OnSet( _
   ByVal index As Integer, _
   ByVal oldValue As Object, _
   ByVal newValue As Object _
)
[C#]
protected override void OnSet(
int index,
object oldValue,
object newValue
);

See Also

BrokenRules.RulesCollection Class | BrokenRules.RulesCollection Members | CSLA Namespace


BusinessBase Class

This is the base class from which most business objects will be derived.

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

System.Object
BindableBase
UndoableBase
BusinessBase

[Visual Basic]
MustInherit Public Class BusinessBase
Inherits UndoableBase
Implements IEditableObject, ICloneable, IDataErrorInfo, ISerializationNotification
[C#]
public abstract class BusinessBase : UndoableBase, IEditableObject, ICloneable, IDataErrorInfo, ISerializationNotification

Remarks

This class is the core of the CSLA .NET framework. To create a business object, inherit from this class.

Please refer to 'Expert One-on-One VB.NET Business Objects' for full details on the use of this base class to create business objects.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BusinessBase Members | CSLA Namespace


BusinessBase Members

Public Instance Constructors

BusinessBase Constructor Initializes a new instance of the BusinessBase class.

Public Instance Properties

IsDeleted | Returns True if this object is marked for deletion.
IsDirty | Returns True if this object's data has been changed.
IsNew | Returns True if this is a new object, False if it is a pre-existing object.
IsSavable | Returns True if this object is both dirty and valid.
IsValid | Returns True if the object is currently valid, False if the object has broken rules or is otherwise invalid.

Public Instance Methods

ApplyEdit | Commits the current edit process.
BeginEdit | Starts a nested edit on the object.
CancelEdit | Cancels the current edit process, restoring the object's state to its previous values.
Clone | Creates a clone of the object.
Delete | Marks the object for deletion. The object will be deleted as part of the next save operation.
DumpState (inherited from UndoableBase) | Writes the object's field data into the debugger output window in VS.NET.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBrokenRulesCollection | Provides access to the readonly collection of broken business rules for this object.
GetBrokenRulesString | Provides access to a text representation of all the descriptions of the currently broken business rules for this object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Save | Saves the object to the database.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

IsDirtyChanged (inherited from BindableBase) Declares a serialization-safe IsDirtyChanged event.

Protected Instance Properties

BrokenRules | Provides access to the broken rules functionality.
EditLevel (inherited from UndoableBase) | Returns the current edit level of the object.

Protected Instance Methods

AddBusinessRules | Override this method in your business class to be notified when you need to set up business rules.
DataPortal_Create | Override this method to load a new business object with default values from the database.
DataPortal_Delete | Override this method to allow immediate deletion of a business object.
DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DataPortal_Update | Override this method to allow insert, update or deletion of a business object.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MarkAsChild | Marks the object as being a child object.
MarkDeleted | Marks an object for deletion. This also marks the object as being dirty.
MarkDirty | Marks an object as being dirty, or changed.
MarkNew | Marks the object as being a new object. This also marks the object as being dirty and ensures that it is not marked for deletion.
MarkOld | Marks the object as being an old (not new) object. This also marks the object as being unchanged (not dirty).
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnIsDirtyChanged (inherited from BindableBase) | Call this method to raise the IsDirtyChanged event.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

Protected Internal Instance Methods

AcceptChanges (inherited from UndoableBase) | Accepts any changes made to the object since the last state copy was made.
CopyState (inherited from UndoableBase) | Copies the state of the object and places the copy onto the state stack.
UndoChanges (inherited from UndoableBase) | Restores the object's state to the most recently copied values from the state stack.

See Also

BusinessBase Class | CSLA Namespace


BusinessBase Constructor

Initializes a new instance of the BusinessBase class.

[Visual Basic]
Public Sub New()
[C#]
public BusinessBase();

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase Properties

The properties of the BusinessBase class are listed below. For a complete list of BusinessBase class members, see the BusinessBase Members topic.

Public Instance Properties

IsDeleted | Returns True if this object is marked for deletion.
IsDirty | Returns True if this object's data has been changed.
IsNew | Returns True if this is a new object, False if it is a pre-existing object.
IsSavable | Returns True if this object is both dirty and valid.
IsValid | Returns True if the object is currently valid, False if the object has broken rules or is otherwise invalid.

Protected Instance Properties

BrokenRules | Provides access to the broken rules functionality.
EditLevel (inherited from UndoableBase) | Returns the current edit level of the object.

See Also

BusinessBase Class | CSLA Namespace


BusinessBase.BrokenRules Property

Provides access to the broken rules functionality.

[Visual Basic]
Protected ReadOnly Property BrokenRules As BrokenRules
[C#]
protected BrokenRules BrokenRules {get;}

Remarks

This property is used within your business logic so you can easily call the Assert method to mark rules as broken and unbroken.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.IsDeleted Property

Returns True if this object is marked for deletion.

[Visual Basic]
Public ReadOnly Property IsDeleted As Boolean
[C#]
public bool IsDeleted {get;}

Remarks

CSLA .NET supports both immediate and deferred deletion of objects. This property is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This property indicates whether or not the current object has been marked for deletion. If it is True, the object will be deleted when it is saved to the database, otherwise it will be inserted or updated by the save operation.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.IsDirty Property

Returns True if this object's data has been changed.

[Visual Basic]
Overridable Public ReadOnly Property IsDirty As Boolean
[C#]
public virtual bool IsDirty {get;}

Remarks

When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty.

Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.IsNew Property

Returns True if this is a new object, False if it is a pre-existing object.

[Visual Basic]
Public ReadOnly Property IsNew As Boolean
[C#]
public bool IsNew {get;}

Remarks

An object is considered to be new if its data doesn't correspond to data in the database. In other words, if the data values in this particular object have not yet been saved to the database the object is considered to be new. Likewise, if the object's data has been deleted from the database then the object is considered to be new.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.IsSavable Property

Returns True if this object is both dirty and valid.

[Visual Basic]
Overridable Public ReadOnly Property IsSavable As Boolean
[C#]
public virtual bool IsSavable {get;}

Remarks

An object is considered dirty (changed) if IsDirty returns True. It is considered valid if IsValid returns True. The IsSavable property is a combination of these two properties. It is provided specifically to enable easy binding to a Save or OK button on a form so that button can automatically enable/disable as the object's state changes between being savable and not savable.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.IsValid Property

Returns True if the object is currently valid, False if the object has broken rules or is otherwise invalid.

[Visual Basic]
Overridable Public ReadOnly Property IsValid As Boolean
[C#]
public virtual bool IsValid {get;}

Remarks

By default this property relies on the underling BrokenRules object to track whether any business rules are currently broken for this object.

You can override this property to provide more sophisticated implementations of the behavior. For instance, you should always override this method if your object has child objects, since the validity of this object is affected by the validity of all child objects.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase Methods

The methods of the BusinessBase class are listed below. For a complete list of BusinessBase class members, see the BusinessBase Members topic.

Public Instance Methods

ApplyEdit | Commits the current edit process.
BeginEdit | Starts a nested edit on the object.
CancelEdit | Cancels the current edit process, restoring the object's state to its previous values.
Clone | Creates a clone of the object.
Delete | Marks the object for deletion. The object will be deleted as part of the next save operation.
DumpState (inherited from UndoableBase) | Writes the object's field data into the debugger output window in VS.NET.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBrokenRulesCollection | Provides access to the readonly collection of broken business rules for this object.
GetBrokenRulesString | Provides access to a text representation of all the descriptions of the currently broken business rules for this object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Save | Saves the object to the database.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

AddBusinessRules | Override this method in your business class to be notified when you need to set up business rules.
DataPortal_Create | Override this method to load a new business object with default values from the database.
DataPortal_Delete | Override this method to allow immediate deletion of a business object.
DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DataPortal_Update | Override this method to allow insert, update or deletion of a business object.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MarkAsChild | Marks the object as being a child object.
MarkDeleted | Marks an object for deletion. This also marks the object as being dirty.
MarkDirty | Marks an object as being dirty, or changed.
MarkNew | Marks the object as being a new object. This also marks the object as being dirty and ensures that it is not marked for deletion.
MarkOld | Marks the object as being an old (not new) object. This also marks the object as being unchanged (not dirty).
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnIsDirtyChanged (inherited from BindableBase) | Call this method to raise the IsDirtyChanged event.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

Protected Internal Instance Methods

AcceptChanges (inherited from UndoableBase) | Accepts any changes made to the object since the last state copy was made.
CopyState (inherited from UndoableBase) | Copies the state of the object and places the copy onto the state stack.
UndoChanges (inherited from UndoableBase) | Restores the object's state to the most recently copied values from the state stack.

See Also

BusinessBase Class | CSLA Namespace


BusinessBase.AddBusinessRules Method

Override this method in your business class to be notified when you need to set up business rules.

[Visual Basic]
Overridable Protected Sub AddBusinessRules()
[C#]
protected virtual void AddBusinessRules();

Remarks

You should call AddBusinessRules from your object's constructor methods so the rules are set up when your object is created. This method will be automatically called, if needed, when your object is serialized by the DataPortal or by the Clone method.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.ApplyEdit Method

Commits the current edit process.

[Visual Basic]
Public Sub ApplyEdit()
[C#]
public void ApplyEdit();

Remarks

Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last BeginEdit call.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.BeginEdit Method

Starts a nested edit on the object.

[Visual Basic]
Public Sub BeginEdit()
[C#]
public void BeginEdit();

Remarks

When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling CancelEdit or committed by calling ApplyEdit.

This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack.

See Chapters 2 and 4 for details on n-level undo and state stacking.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.CancelEdit Method

Cancels the current edit process, restoring the object's state to its previous values.

[Visual Basic]
Public Sub CancelEdit()
[C#]
public void CancelEdit();

Remarks

Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last BeginEdit call.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.Clone Method

Creates a clone of the object.

[Visual Basic]
NotOverridable Public Function Clone() As Object Implements _
   ICloneable.Clone
[C#]
public object Clone();

Return Value

A new object containing the exact data of the original object.

Implements

ICloneable.Clone

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.DataPortal_Create Method

Override this method to load a new business object with default values from the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Create( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Create(
object Criteria
);

Parameters

Criteria
An object containing criteria values.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.DataPortal_Delete Method

Override this method to allow immediate deletion of a business object.

[Visual Basic]
Overridable Protected Sub DataPortal_Delete( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Delete(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.DataPortal_Fetch Method

Override this method to allow retrieval of an existing business object based on data in the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Fetch( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Fetch(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.DataPortal_Update Method

Override this method to allow insert, update or deletion of a business object.

[Visual Basic]
Overridable Protected Sub DataPortal_Update()
[C#]
protected virtual void DataPortal_Update();

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.DB Method

Returns the specified database connection string from the application configuration file.

[Visual Basic]
Protected Function DB( _
   ByVal DatabaseName As String _
) As String
[C#]
protected string DB(
string DatabaseName
);

Parameters

DatabaseName
Name of the database.

Return Value

A database connection string.

Remarks

The database connection string must be in the appSettings section of the application configuration file. The database name should be prefixed with 'DB:'. For instance, DB:mydatabase.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.Delete Method

Marks the object for deletion. The object will be deleted as part of the next save operation.

[Visual Basic]
Public Sub Delete()
[C#]
public void Delete();

Remarks

CSLA .NET supports both immediate and deferred deletion of objects. This method is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This method is called by the UI developer to mark the object for deletion.

To 'undelete' an object, use BeginEdit before calling the Delete method. You can then use CancelEdit later to reset the object's state to its original values. This will include resetting the deleted flag to False.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.Deserialized Method

This method is called on a newly deserialized object after deserialization is complete.

[Visual Basic]
Overridable Protected Sub Deserialized() Implements _
   ISerializationNotification.Deserialized
[C#]
protected virtual void Deserialized();

Implements

ISerializationNotification.Deserialized

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.GetBrokenRulesCollection Method

Provides access to the readonly collection of broken business rules for this object.

[Visual Basic]
Overridable Public Function GetBrokenRulesCollection() As RulesCollection
[C#]
public virtual RulesCollection GetBrokenRulesCollection();

Return Value

A BrokenRules.RulesCollection object.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.GetBrokenRulesString Method

Provides access to a text representation of all the descriptions of the currently broken business rules for this object.

[Visual Basic]
Overridable Public Function GetBrokenRulesString() As String
[C#]
public virtual string GetBrokenRulesString();

Return Value

Text containing the descriptions of the broken business rules.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.MarkAsChild Method

Marks the object as being a child object.

[Visual Basic]
Protected Sub MarkAsChild()
[C#]
protected void MarkAsChild();

Remarks

By default all business objects are 'parent' objects. This means that they can be directly retrieved and updated into the database.

We often also need child objects. These are objects which are contained within other objects. For instance, a parent Invoice object will contain child LineItem objects.

To create a child object, the MarkAsChild method must be called as the object is created. Please see Chapter 7 for details on the use of the MarkAsChild method.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.MarkDeleted Method

Marks an object for deletion. This also marks the object as being dirty.

[Visual Basic]
Protected Sub MarkDeleted()
[C#]
protected void MarkDeleted();

Remarks

You should call this method in your business logic in the case that you want to have the object deleted when it is saved to the database.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.MarkDirty Method

Marks an object as being dirty, or changed.

[Visual Basic]
Protected Sub MarkDirty()
[C#]
protected void MarkDirty();

Remarks

You should call this method in your business logic any time the object's internal data changes. Any time any instance variable changes within the object, this method should be called to tell CSLA .NET that the object's data has been changed.

Marking an object as dirty does two things. First it ensures that CSLA .NET will properly save the object as appropriate. Second, it causes CSLA .NET to tell Windows Forms data binding that the object's data has changed so any bound controls will update to reflect the new values.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.MarkNew Method

Marks the object as being a new object. This also marks the object as being dirty and ensures that it is not marked for deletion.

[Visual Basic]
Protected Sub MarkNew()
[C#]
protected void MarkNew();

Remarks

Newly created objects are marked new by default. You should call this method in the implementation of DataPortal_Update when the object is deleted (due to being marked for deletion) to indicate that the object no longer reflects data in the database.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.MarkOld Method

Marks the object as being an old (not new) object. This also marks the object as being unchanged (not dirty).

[Visual Basic]
Protected Sub MarkOld()
[C#]
protected void MarkOld();

Remarks

You should call this method in the implementation of DataPortal_Fetch to indicate that an existing object has been successfully retrieved from the database.

You should call this method in the implementation of DataPortal_Update to indicate that a new object has been successfully inserted into the database.

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.Save Method

Saves the object to the database.

[Visual Basic]
Overridable Public Function Save() As BusinessBase
[C#]
public virtual BusinessBase Save();

Return Value

A new object containing the saved values.

Remarks

Calling this method starts the save operation, causing the object to be inserted, updated or deleted within the database based on the object's current state.

If IsDeleted is True the object will be deleted. Otherwise, if IsNew is True the object will be inserted. Otherwise the object's data will be updated in the database.

All this is contingent on IsDirty. If this value is False, no data operation occurs. It is also contingent on IsValid. If this value is False an exception will be thrown to indicate that the UI attempted to save an invalid object.

It is important to note that this method returns a new version of the business object that contains any data updated during the save operation. You MUST update all object references to use this new version of the business object in order to have access to the correct object data.

You can override this method to add your own custom behaviors to the save operation. For instance, you may add some security checks to make sure the user can save the object. If all security checks pass, you would then invoke the base Save method via MyBase.Save().

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.Serialized Method

This method is called on the original instance of the object after it has been serialized.

[Visual Basic]
Overridable Protected Sub Serialized() Implements _
   ISerializationNotification.Serialized
[C#]
protected virtual void Serialized();

Implements

ISerializationNotification.Serialized

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessBase.Serializing Method

This method is called before an object is serialized.

[Visual Basic]
Overridable Protected Sub Serializing() Implements _
   ISerializationNotification.Serializing
[C#]
protected virtual void Serializing();

Implements

ISerializationNotification.Serializing

See Also

BusinessBase Class | BusinessBase Members | CSLA Namespace


BusinessCollectionBase Class

This is the base class from which most business collection objects will be derived.

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

System.Object
CollectionBase
BindableCollectionBase
SortableCollectionBase
BusinessCollectionBase

[Visual Basic]
MustInherit Public Class BusinessCollectionBase
Inherits SortableCollectionBase
Implements ICloneable, ISerializationNotification
[C#]
public abstract class BusinessCollectionBase : SortableCollectionBase, ICloneable, ISerializationNotification

Remarks

To create a collection of business objects, inherit from this class. The business objects contained in this collection must inherit from BusinessBase, and the objects must be marked as child objects.

Please refer to 'Expert One-on-One VB.NET Business Objects' for full details on the use of this base class to create business collections.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase Members

Public Instance Constructors

BusinessCollectionBase Constructor Initializes a new instance of the BusinessCollectionBase class.

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
IsDirty | Returns True if this object's data has been changed.
IsValid | Returns True if the object is currently valid, False if the object has broken rules or is otherwise invalid.

Public Instance Methods

ApplyEdit | Commits the current edit process.
BeginEdit | Starts a nested edit on the object.
CancelEdit | Cancels the current edit process, restoring the object's state to its previous values.
Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Clone | Creates a clone of the object.
Contains | Used to see if the collection contains a specific child object.
ContainsDeleted | Used to see if the collection contains a reference to a child object that is marked for deletion.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
Save | Saves the object to the database.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ListChanged (inherited from BindableCollectionBase) Declares a serialization-safe ListChanged event.

Protected Instance Fields

AllowEdit (inherited from BindableCollectionBase) | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind (inherited from BindableCollectionBase) | Set this to True to allow this collection to be searched.
AllowNew (inherited from BindableCollectionBase) | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove (inherited from BindableCollectionBase) | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort (inherited from BindableCollectionBase) | Set this to True to allow this collection to be sorted.
deletedList | A collection containing all child objects marked for deletion.

Protected Instance Properties

ActivelySorting (inherited from SortableCollectionBase) | Indicates whether the collection is in the process of being sorted at this time.
IBindingList_IsSorted (inherited from SortableCollectionBase) | Returns a value indicating whether the collection is currently sorted.
IBindingList_SortDirection (inherited from SortableCollectionBase) | Returns the current sort direction.
IBindingList_SortProperty (inherited from SortableCollectionBase) | Returns the property by which the collection is currently sorted.
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
IsChild | Indicates whether this collection object is a child object.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

DataPortal_Create | Override this method to load a new business object with default values from the database.
DataPortal_Delete | Override this method to allow immediate deletion of a business object.
DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DataPortal_Update | Override this method to allow insert, update or deletion of a business object.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort (inherited from SortableCollectionBase) | Applies a sort to the collection.
IBindingList_Find (inherited from SortableCollectionBase) | Implements search/find functionality for the collection.
IBindingList_RemoveSort (inherited from SortableCollectionBase) | Removes any sort from the collection.
MarkAsChild | Marks the object as being a child object.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear | Marks all child objects for deletion and moves them to the collection of deleted objects.
OnClearComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as the list is cleared.
OnInsert | Sets the edit level of the child object as it is added.
OnInsertComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as a new item is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove | Marks the child object for deletion and moves it to the collection of deleted objects.
OnRemoveComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as an item is removed.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BusinessCollectionBase Class | CSLA Namespace


BusinessCollectionBase Constructor

Initializes a new instance of the BusinessCollectionBase class.

[Visual Basic]
Public Sub New()
[C#]
public BusinessCollectionBase();

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase Fields

The fields of the BusinessCollectionBase class are listed below. For a complete list of BusinessCollectionBase class members, see the BusinessCollectionBase Members topic.

Protected Instance Fields

AllowEdit (inherited from BindableCollectionBase) | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind (inherited from BindableCollectionBase) | Set this to True to allow this collection to be searched.
AllowNew (inherited from BindableCollectionBase) | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove (inherited from BindableCollectionBase) | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort (inherited from BindableCollectionBase) | Set this to True to allow this collection to be sorted.
deletedList | A collection containing all child objects marked for deletion.

See Also

BusinessCollectionBase Class | CSLA Namespace


BusinessCollectionBase.deletedList Field

A collection containing all child objects marked for deletion.

[Visual Basic]
Protected deletedList As DeletedCollection
[C#]
protected DeletedCollection deletedList;

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase Properties

The properties of the BusinessCollectionBase class are listed below. For a complete list of BusinessCollectionBase class members, see the BusinessCollectionBase Members topic.

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
IsDirty | Returns True if this object's data has been changed.
IsValid | Returns True if the object is currently valid, False if the object has broken rules or is otherwise invalid.

Protected Instance Properties

ActivelySorting (inherited from SortableCollectionBase) | Indicates whether the collection is in the process of being sorted at this time.
IBindingList_IsSorted (inherited from SortableCollectionBase) | Returns a value indicating whether the collection is currently sorted.
IBindingList_SortDirection (inherited from SortableCollectionBase) | Returns the current sort direction.
IBindingList_SortProperty (inherited from SortableCollectionBase) | Returns the property by which the collection is currently sorted.
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
IsChild | Indicates whether this collection object is a child object.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

See Also

BusinessCollectionBase Class | CSLA Namespace


BusinessCollectionBase.IsChild Property

Indicates whether this collection object is a child object.

[Visual Basic]
Protected ReadOnly Property IsChild As Boolean
[C#]
protected bool IsChild {get;}

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.IsDirty Property

Returns True if this object's data has been changed.

[Visual Basic]
Public ReadOnly Property IsDirty As Boolean
[C#]
public bool IsDirty {get;}

Remarks

When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty.

Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged.

If any child object within the collection is dirty then the collection is considered to be dirty. If all child objects are unchanged, then the collection is not dirty.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.IsValid Property

Returns True if the object is currently valid, False if the object has broken rules or is otherwise invalid.

[Visual Basic]
Public ReadOnly Property IsValid As Boolean
[C#]
public bool IsValid {get;}

Remarks

By default this property relies on the underling BrokenRules object to track whether any business rules are currently broken for this object.

You can override this property to provide more sophisticated implementations of the behavior. For instance, you should always override this method if your object has child objects, since the validity of this object is affected by the validity of all child objects.

If any child object within the collection is invalid then the collection is considered to be invalid. If all child objects are valid, then the collection is valid.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase Methods

The methods of the BusinessCollectionBase class are listed below. For a complete list of BusinessCollectionBase class members, see the BusinessCollectionBase Members topic.

Public Instance Methods

ApplyEdit | Commits the current edit process.
BeginEdit | Starts a nested edit on the object.
CancelEdit | Cancels the current edit process, restoring the object's state to its previous values.
Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Clone | Creates a clone of the object.
Contains | Used to see if the collection contains a specific child object.
ContainsDeleted | Used to see if the collection contains a reference to a child object that is marked for deletion.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
Save | Saves the object to the database.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

DataPortal_Create | Override this method to load a new business object with default values from the database.
DataPortal_Delete | Override this method to allow immediate deletion of a business object.
DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DataPortal_Update | Override this method to allow insert, update or deletion of a business object.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort (inherited from SortableCollectionBase) | Applies a sort to the collection.
IBindingList_Find (inherited from SortableCollectionBase) | Implements search/find functionality for the collection.
IBindingList_RemoveSort (inherited from SortableCollectionBase) | Removes any sort from the collection.
MarkAsChild | Marks the object as being a child object.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear | Marks all child objects for deletion and moves them to the collection of deleted objects.
OnClearComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as the list is cleared.
OnInsert | Sets the edit level of the child object as it is added.
OnInsertComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as a new item is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove | Marks the child object for deletion and moves it to the collection of deleted objects.
OnRemoveComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as an item is removed.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BusinessCollectionBase Class | CSLA Namespace


BusinessCollectionBase.ApplyEdit Method

Commits the current edit process.

[Visual Basic]
Public Sub ApplyEdit()
[C#]
public void ApplyEdit();

Remarks

Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last BeginEdit call.

This method triggers an ApplyEdit in all child objects.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.BeginEdit Method

Starts a nested edit on the object.

[Visual Basic]
Public Sub BeginEdit()
[C#]
public void BeginEdit();

Remarks

When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling CancelEdit or committed by calling ApplyEdit.

This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack.

See Chapters 2 and 4 for details on n-level undo and state stacking.

This method triggers the copying of all child object states.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.CancelEdit Method

Cancels the current edit process, restoring the object's state to its previous values.

[Visual Basic]
Public Sub CancelEdit()
[C#]
public void CancelEdit();

Remarks

Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last BeginEdit call.

This method triggers an undo in all child objects.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.Clone Method

Creates a clone of the object.

[Visual Basic]
NotOverridable Public Function Clone() As Object Implements _
   ICloneable.Clone
[C#]
public object Clone();

Return Value

A new object containing the exact data of the original object.

Implements

ICloneable.Clone

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.Contains Method

Used to see if the collection contains a specific child object.

[Visual Basic]
Public Function Contains( _
   ByVal Item As BusinessBase _
) As Boolean
[C#]
public bool Contains(
BusinessBase Item
);

Parameters

Item
A reference to the object.

Return Value

True if the collection contains the object.

Remarks

Only the 'active' list of child objects is checked. Business collections also contain deleted objects, which are not checked by this call.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.ContainsDeleted Method

Used to see if the collection contains a reference to a child object that is marked for deletion.

[Visual Basic]
Public Function ContainsDeleted( _
   ByVal Item As BusinessBase _
) As Boolean
[C#]
public bool ContainsDeleted(
BusinessBase Item
);

Parameters

Item
A reference to the object.

Return Value

True if the collection contains the object.

Remarks

This scans the list of child objects that have been marked for deletion. If this object is in that list, the method returns True.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.DataPortal_Create Method

Override this method to load a new business object with default values from the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Create( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Create(
object Criteria
);

Parameters

Criteria
An object containing criteria values.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.DataPortal_Delete Method

Override this method to allow immediate deletion of a business object.

[Visual Basic]
Overridable Protected Sub DataPortal_Delete( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Delete(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.DataPortal_Fetch Method

Override this method to allow retrieval of an existing business object based on data in the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Fetch( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Fetch(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.DataPortal_Update Method

Override this method to allow insert, update or deletion of a business object.

[Visual Basic]
Overridable Protected Sub DataPortal_Update()
[C#]
protected virtual void DataPortal_Update();

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.DB Method

Returns the specified database connection string from the application configuration file.

[Visual Basic]
Protected Function DB( _
   ByVal DatabaseName As String _
) As String
[C#]
protected string DB(
string DatabaseName
);

Parameters

DatabaseName
Name of the database.

Return Value

A database connection string.

Remarks

The database connection string must be in the appSettings section of the application configuration file. The database name should be prefixed with 'DB:'. For instance, DB:mydatabase.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.Deserialized Method

This method is called on a newly deserialized object after deserialization is complete.

[Visual Basic]
Overridable Protected Sub Deserialized() Implements _
   ISerializationNotification.Deserialized
[C#]
protected virtual void Deserialized();

Implements

ISerializationNotification.Deserialized

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.MarkAsChild Method

Marks the object as being a child object.

[Visual Basic]
Protected Sub MarkAsChild()
[C#]
protected void MarkAsChild();

Remarks

By default all business objects are 'parent' objects. This means that they can be directly retrieved and updated into the database.

We often also need child objects. These are objects which are contained within other objects. For instance, a parent Invoice object will contain child LineItem objects.

To create a child object, the MarkAsChild method must be called as the object is created. Please see Chapter 7 for details on the use of the MarkAsChild method.

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.OnClear Method

Marks all child objects for deletion and moves them to the collection of deleted objects.

[Visual Basic]
Overrides Protected Sub OnClear()
[C#]
protected override void OnClear();

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.OnInsert Method

Sets the edit level of the child object as it is added.

[Visual Basic]
Overrides Protected Sub OnInsert( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnInsert(
int index,
object value
);

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.OnRemove Method

Marks the child object for deletion and moves it to the collection of deleted objects.

[Visual Basic]
Overrides Protected Sub OnRemove( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnRemove(
int index,
object value
);

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.Save Method

Saves the object to the database.

[Visual Basic]
Overridable Public Function Save() As BusinessCollectionBase
[C#]
public virtual BusinessCollectionBase Save();

Return Value

A new object containing the saved values.

Remarks

Calling this method starts the save operation, causing the all child objects to be inserted, updated or deleted within the database based on the each object's current state.

All this is contingent on IsDirty. If this value is False, no data operation occurs. It is also contingent on IsValid. If this value is False an exception will be thrown to indicate that the UI attempted to save an invalid object.

It is important to note that this method returns a new version of the business collection that contains any data updated during the save operation. You MUST update all object references to use this new version of the business collection in order to have access to the correct object data.

You can override this method to add your own custom behaviors to the save operation. For instance, you may add some security checks to make sure the user can save the object. If all security checks pass, you would then invoke the base Save method via MyBase.Save().

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.Serialized Method

This method is called on the original instance of the object after it has been serialized.

[Visual Basic]
Overridable Protected Sub Serialized() Implements _
   ISerializationNotification.Serialized
[C#]
protected virtual void Serialized();

Implements

ISerializationNotification.Serialized

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.Serializing Method

This method is called before an object is serialized.

[Visual Basic]
Overridable Protected Sub Serializing() Implements _
   ISerializationNotification.Serializing
[C#]
protected virtual void Serializing();

Implements

ISerializationNotification.Serializing

See Also

BusinessCollectionBase Class | BusinessCollectionBase Members | CSLA Namespace


BusinessCollectionBase.DeletedCollection Class

Defines a strongly-typed collection to store all child objects marked for deletion.

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

System.Object
CollectionBase
BusinessCollectionBase.DeletedCollection

[Visual Basic]
Protected Class BusinessCollectionBase.DeletedCollection
Inherits CollectionBase
[C#]
protected class BusinessCollectionBase.DeletedCollection : CollectionBase

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

BusinessCollectionBase.DeletedCollection Members | CSLA Namespace


BusinessCollectionBase.DeletedCollection Members

Public Instance Constructors

BusinessCollectionBase.DeletedCollection Constructor Initializes a new instance of the DeletedCollection class.

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
Item | Returns a reference to a child object in the collection.

Public Instance Methods

Add | Adds a child object to the collection.
Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes a child object from the collection.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Properties

InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete (inherited from CollectionBase) | Performs additional custom processes after clearing the contents of the CollectionBase instance.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete (inherited from CollectionBase) | Performs additional custom processes after inserting a new element into the CollectionBase instance.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete (inherited from CollectionBase) | Performs additional custom processes after removing an element from the CollectionBase instance.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from CollectionBase) | Performs additional custom processes after setting a value in the CollectionBase instance.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BusinessCollectionBase.DeletedCollection Class | CSLA Namespace


BusinessCollectionBase.DeletedCollection Constructor

Initializes a new instance of the DeletedCollection class.

[Visual Basic]
Public Sub New()
[C#]
public BusinessCollectionBase.DeletedCollection();

See Also

BusinessCollectionBase.DeletedCollection Class | BusinessCollectionBase.DeletedCollection Members | CSLA Namespace


BusinessCollectionBase.DeletedCollection Properties

The properties of the BusinessCollectionBase.DeletedCollection class are listed below. For a complete list of BusinessCollectionBase.DeletedCollection class members, see the BusinessCollectionBase.DeletedCollection Members topic.

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
Item | Returns a reference to a child object in the collection.

Protected Instance Properties

InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

See Also

BusinessCollectionBase.DeletedCollection Class | CSLA Namespace


BusinessCollectionBase.DeletedCollection.Item Property

Returns a reference to a child object in the collection.

[Visual Basic]
Public Default ReadOnly Property Item( _
ByVal index As Integer _
) As BusinessBase
[C#]
public BusinessBase this[
int index
] {get;}

Parameters

index
The positional index of the item in the collection.

See Also

BusinessCollectionBase.DeletedCollection Class | BusinessCollectionBase.DeletedCollection Members | CSLA Namespace


BusinessCollectionBase.DeletedCollection Methods

The methods of the BusinessCollectionBase.DeletedCollection class are listed below. For a complete list of BusinessCollectionBase.DeletedCollection class members, see the BusinessCollectionBase.DeletedCollection Members topic.

Public Instance Methods

Add | Adds a child object to the collection.
Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes a child object from the collection.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete (inherited from CollectionBase) | Performs additional custom processes after clearing the contents of the CollectionBase instance.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete (inherited from CollectionBase) | Performs additional custom processes after inserting a new element into the CollectionBase instance.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete (inherited from CollectionBase) | Performs additional custom processes after removing an element from the CollectionBase instance.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from CollectionBase) | Performs additional custom processes after setting a value in the CollectionBase instance.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BusinessCollectionBase.DeletedCollection Class | CSLA Namespace


BusinessCollectionBase.DeletedCollection.Add Method

Adds a child object to the collection.

[Visual Basic]
Public Sub Add( _
   ByVal Child As BusinessBase _
)
[C#]
public void Add(
BusinessBase Child
);

Parameters

Child
The child object to be added.

See Also

BusinessCollectionBase.DeletedCollection Class | BusinessCollectionBase.DeletedCollection Members | CSLA Namespace


BusinessCollectionBase.DeletedCollection.Remove Method

Removes a child object from the collection.

[Visual Basic]
Public Sub Remove( _
   ByVal Child As BusinessBase _
)
[C#]
public void Remove(
BusinessBase Child
);

Parameters

Child
The child object to be removed.

See Also

BusinessCollectionBase.DeletedCollection Class | BusinessCollectionBase.DeletedCollection Members | CSLA Namespace


CriteriaBase Class

Base type from which Criteria classes can be derived in a business class.

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

System.Object
CriteriaBase

[Visual Basic]
MustInherit Public Class CriteriaBase
[C#]
public abstract class CriteriaBase

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.Server.DataPortal.dll

See Also

CriteriaBase Members | CSLA Namespace


CriteriaBase Members

Public Instance Constructors

CriteriaBase Constructor Initializes CriteriaBase with the type of business object to be created by the DataPortal.

Public Instance Fields

ObjectType Type of the business object to be instantiated by the server-side DataPortal.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CriteriaBase Class | CSLA Namespace


CriteriaBase Constructor

Initializes CriteriaBase with the type of business object to be created by the DataPortal.

[Visual Basic]
Public Sub New( _
   ByVal Type As Type _
)
[C#]
public CriteriaBase(
Type Type
);

See Also

CriteriaBase Class | CriteriaBase Members | CSLA Namespace


CriteriaBase Fields

The fields of the CriteriaBase class are listed below. For a complete list of CriteriaBase class members, see the CriteriaBase Members topic.

Public Instance Fields

ObjectType Type of the business object to be instantiated by the server-side DataPortal.

See Also

CriteriaBase Class | CSLA Namespace


CriteriaBase.ObjectType Field

Type of the business object to be instantiated by the server-side DataPortal.

[Visual Basic]
Public ObjectType As Type
[C#]
public Type ObjectType;

See Also

CriteriaBase Class | CriteriaBase Members | CSLA Namespace


DataPortal Class

This is the client-side DataPortal as described in Chapter 5.

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

System.Object
DataPortal

[Visual Basic]
Public Class DataPortal
[C#]
public class DataPortal

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

DataPortal Members | CSLA Namespace


DataPortal Members

Public Static (Shared) Methods

Create | Called by a factory method in a business class to create a new object, which is loaded with default values from the database.
Delete | Called by a Shared method in the business class to cause immediate deletion of a specific object from the database.
Fetch | Called by a factory method in a business class to retrieve an object, which is loaded with values from the database.
Update | Called by the Save method to insert, update or delete an object in the database.

Public Instance Constructors

DataPortal Constructor Initializes a new instance of the DataPortal class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DataPortal Class | CSLA Namespace


DataPortal Constructor

Initializes a new instance of the DataPortal class.

[Visual Basic]
Public Sub New()
[C#]
public DataPortal();

See Also

DataPortal Class | DataPortal Members | CSLA Namespace


DataPortal Methods

The methods of the DataPortal class are listed below. For a complete list of DataPortal class members, see the DataPortal Members topic.

Public Static (Shared) Methods

Create | Called by a factory method in a business class to create a new object, which is loaded with default values from the database.
Delete | Called by a Shared method in the business class to cause immediate deletion of a specific object from the database.
Fetch | Called by a factory method in a business class to retrieve an object, which is loaded with values from the database.
Update | Called by the Save method to insert, update or delete an object in the database.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DataPortal Class | CSLA Namespace


DataPortal.Create Method

Called by a factory method in a business class to create a new object, which is loaded with default values from the database.

[Visual Basic]
Public Shared Function Create( _
   ByVal Criteria As Object _
) As Object
[C#]
public static object Create(
object Criteria
);

Parameters

Criteria
Object-specific criteria.

Return Value

A new object, populated with default values.

See Also

DataPortal Class | DataPortal Members | CSLA Namespace


DataPortal.Delete Method

Called by a Shared method in the business class to cause immediate deletion of a specific object from the database.

[Visual Basic]
Public Shared Sub Delete( _
   ByVal Criteria As Object _
)
[C#]
public static void Delete(
object Criteria
);

Parameters

Criteria
Object-specific criteria.

See Also

DataPortal Class | DataPortal Members | CSLA Namespace


DataPortal.Fetch Method

Called by a factory method in a business class to retrieve an object, which is loaded with values from the database.

[Visual Basic]
Public Shared Function Fetch( _
   ByVal Criteria As Object _
) As Object
[C#]
public static object Fetch(
object Criteria
);

Parameters

Criteria
Object-specific criteria.

Return Value

An object populated with values from the database.

See Also

DataPortal Class | DataPortal Members | CSLA Namespace


DataPortal.Update Method

Called by the Save method to insert, update or delete an object in the database.

[Visual Basic]
Public Shared Function Update( _
   ByVal obj As Object _
) As Object
[C#]
public static object Update(
object obj
);

Parameters

obj
A reference to the business object to be updated.

Return Value

A reference to the updated business object.

Remarks

Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object.

See Also

DataPortal Class | DataPortal Members | CSLA Namespace


NameValueList Class

This is a base class from which readonly name/value business classes can be quickly and easily created.

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

System.Object
NameObjectCollectionBase
NameValueList

[Visual Basic]
MustInherit Public Class NameValueList
Inherits NameObjectCollectionBase
Implements ICloneable
[C#]
public abstract class NameValueList : NameObjectCollectionBase, ICloneable

Remarks

As discussed in Chapter 5, inherit from this class to quickly and easily create name/value list objects for population of ListBox or ComboBox controls and for validation of list-based data items in your business objects.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

NameValueList Members | CSLA Namespace


NameValueList Members

Public Instance Properties

Count (inherited from NameObjectCollectionBase) | Gets the number of key-and-value pairs contained in the NameObjectCollectionBase instance.
Item | Overloaded. Returns a value from the list.
Key | Returns the first name found in the list with the specified value.
Keys (inherited from NameObjectCollectionBase) | Gets a KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.

Public Instance Methods

Clone | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from NameObjectCollectionBase) | Returns an enumerator that can iterate through the NameObjectCollectionBase.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from NameObjectCollectionBase) | Implements the ISerializable interface and returns the data needed to serialize the NameObjectCollectionBase instance.
GetType (inherited from Object) | Gets the Type of the current instance.
OnDeserialization (inherited from NameObjectCollectionBase) | Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Constructors

NameValueList Overloaded. Initialize a new instance of the NameValueList class.

Protected Instance Properties

IsReadOnly (inherited from NameObjectCollectionBase) Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

Protected Instance Methods

Add | Adds a name/value pair to the list.
BaseAdd (inherited from NameObjectCollectionBase) | Adds an entry with the specified key and value into the NameObjectCollectionBase instance.
BaseClear (inherited from NameObjectCollectionBase) | Removes all entries from the NameObjectCollectionBase instance.
BaseGet (inherited from NameObjectCollectionBase) | Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.
BaseGet (inherited from NameObjectCollectionBase) | Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.
BaseGetAllKeys (inherited from NameObjectCollectionBase) | Returns a String array that contains all the keys in the NameObjectCollectionBase instance.
BaseGetAllValues (inherited from NameObjectCollectionBase) | Returns an Object array that contains all the values in the NameObjectCollectionBase instance.
BaseGetAllValues (inherited from NameObjectCollectionBase) | Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.
BaseGetKey (inherited from NameObjectCollectionBase) | Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.
BaseHasKeys (inherited from NameObjectCollectionBase) | Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not a null reference (Nothing in Visual Basic).
BaseRemove (inherited from NameObjectCollectionBase) | Removes the entries with the specified key from the NameObjectCollectionBase instance.
BaseRemoveAt (inherited from NameObjectCollectionBase) | Removes the entry at the specified index of the NameObjectCollectionBase instance.
BaseSet (inherited from NameObjectCollectionBase) | Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.
BaseSet (inherited from NameObjectCollectionBase) | Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.
DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DB | Returns the specified database connection string from the application configuration file.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
SimpleFetch | Provides default/simple loading for most lists. It is called to load data from the database

Explicit Interface Implementations

ICollection.CopyTo (inherited from NameObjectCollectionBase)

See Also

NameValueList Class | CSLA Namespace


NameValueList Constructor

Creates a new NameValueList.

Overload List

Creates a new NameValueList.

protected NameValueList();

Creates a new NameValueList.

protected NameValueList(SerializationInfo,StreamingContext);

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList Constructor ()

Creates a new NameValueList.

[Visual Basic]
Overloads Protected Sub New()
[C#]
protected NameValueList();

See Also

NameValueList Class | NameValueList Members | CSLA Namespace | NameValueList Constructor Overload List


NameValueList Constructor (SerializationInfo, StreamingContext)

Creates a new NameValueList.

[Visual Basic]
Overloads Protected Sub New( _
   ByVal info As SerializationInfo, _
   ByVal context As StreamingContext _
)
[C#]
protected NameValueList(
SerializationInfo info,
StreamingContext context
);

See Also

NameValueList Class | NameValueList Members | CSLA Namespace | NameValueList Constructor Overload List


NameValueList Properties

The properties of the NameValueList class are listed below. For a complete list of NameValueList class members, see the NameValueList Members topic.

Public Instance Properties

Count (inherited from NameObjectCollectionBase) | Gets the number of key-and-value pairs contained in the NameObjectCollectionBase instance.
Item | Overloaded. Returns a value from the list.
Key | Returns the first name found in the list with the specified value.
Keys (inherited from NameObjectCollectionBase) | Gets a KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.

Protected Instance Properties

IsReadOnly (inherited from NameObjectCollectionBase) Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

See Also

NameValueList Class | CSLA Namespace


Item Property

CSLA .NET

NameValueList.Item Property

Returns a value from the list.

Overload List

Returns a value from the list.

public string this[int] {get;}

public string this[string] {get;}

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList.Item Property

Returns a value from the list.

[Visual Basic]
Overloads Public Default ReadOnly Property Item( _
ByVal Index As Integer _
) As String
[C#]
public string this[
int Index
] {get;}

Parameters

Index

See Also

NameValueList Class | NameValueList Members | CSLA Namespace | NameValueList.Item Overload List


NameValueList.Item Property

[Visual Basic]
Overloads Public Default ReadOnly Property Item( _
ByVal Name As String _
) As String
[C#]
public string this[
string Name
] {get;}

See Also

NameValueList Class | NameValueList Members | CSLA Namespace | NameValueList.Item Overload List


NameValueList.Key Property

Returns the first name found in the list with the specified value.

[Visual Basic]
Public Default ReadOnly Property Key( _
ByVal Item As String _
) As String
[C#]
public string this[
string Item
] {get;}

Parameters

Item
The value to search for in the list.

Remarks

This method throws an exception if no matching value is found in the list.

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList Methods

The methods of the NameValueList class are listed below. For a complete list of NameValueList class members, see the NameValueList Members topic.

Public Instance Methods

Clone | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from NameObjectCollectionBase) | Returns an enumerator that can iterate through the NameObjectCollectionBase.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from NameObjectCollectionBase) | Implements the ISerializable interface and returns the data needed to serialize the NameObjectCollectionBase instance.
GetType (inherited from Object) | Gets the Type of the current instance.
OnDeserialization (inherited from NameObjectCollectionBase) | Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Add | Adds a name/value pair to the list.
BaseAdd (inherited from NameObjectCollectionBase) | Adds an entry with the specified key and value into the NameObjectCollectionBase instance.
BaseClear (inherited from NameObjectCollectionBase) | Removes all entries from the NameObjectCollectionBase instance.
BaseGet (inherited from NameObjectCollectionBase) | Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.
BaseGet (inherited from NameObjectCollectionBase) | Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.
BaseGetAllKeys (inherited from NameObjectCollectionBase) | Returns a String array that contains all the keys in the NameObjectCollectionBase instance.
BaseGetAllValues (inherited from NameObjectCollectionBase) | Returns an Object array that contains all the values in the NameObjectCollectionBase instance.
BaseGetAllValues (inherited from NameObjectCollectionBase) | Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.
BaseGetKey (inherited from NameObjectCollectionBase) | Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.
BaseHasKeys (inherited from NameObjectCollectionBase) | Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not a null reference (Nothing in Visual Basic).
BaseRemove (inherited from NameObjectCollectionBase) | Removes the entries with the specified key from the NameObjectCollectionBase instance.
BaseRemoveAt (inherited from NameObjectCollectionBase) | Removes the entry at the specified index of the NameObjectCollectionBase instance.
BaseSet (inherited from NameObjectCollectionBase) | Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.
BaseSet (inherited from NameObjectCollectionBase) | Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.
DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DB | Returns the specified database connection string from the application configuration file.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
SimpleFetch | Provides default/simple loading for most lists. It is called to load data from the database

Explicit Interface Implementations

ICollection.CopyTo (inherited from NameObjectCollectionBase)

See Also

NameValueList Class | CSLA Namespace


NameValueList.Add Method

Adds a name/value pair to the list.

[Visual Basic]
Protected Sub Add( _
   ByVal Name As String, _
   ByVal Value As String _
)
[C#]
protected void Add(
string Name,
string Value
);

Parameters

Name
The name of the item.
Value
The value to be added.

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList.Clone Method

Creates a clone of the object.

[Visual Basic]
NotOverridable Public Function Clone() As Object Implements _
   ICloneable.Clone
[C#]
public object Clone();

Return Value

A new object containing the exact data of the original object.

Implements

ICloneable.Clone

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList.DataPortal_Fetch Method

Override this method to allow retrieval of an existing business object based on data in the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Fetch( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Fetch(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

Remarks

In many cases you can call the SimpleFetch method to retrieve simple name/value data from a single table in a database. In more complex cases you may need to implement your own data retrieval code using ADO.NET.

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList.DB Method

Returns the specified database connection string from the application configuration file.

[Visual Basic]
Protected Function DB( _
   ByVal DatabaseName As String _
) As String
[C#]
protected string DB(
string DatabaseName
);

Parameters

DatabaseName
Name of the database.

Return Value

A database connection string.

Remarks

The database connection string must be in the appSettings section of the application configuration file. The database name should be prefixed with 'DB:'. For instance, DB:mydatabase.

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NameValueList.SimpleFetch Method

Provides default/simple loading for most lists. It is called to load data from the database

[Visual Basic]
Protected Sub SimpleFetch( _
   ByVal DataBaseName As String, _
   ByVal TableName As String, _
   ByVal NameColumn As String, _
   ByVal ValueColumn As String _
)
[C#]
protected void SimpleFetch(
string DataBaseName,
string TableName,
string NameColumn,
string ValueColumn
);

Parameters

DataBaseName
The name of the database to read. This database name must correspond to a database entry in the application configuration file.
TableName
The name of the table to read.
NameColumn
The name of the column containing name or key values.
ValueColumn
The name of the column containing data values.

See Also

NameValueList Class | NameValueList Members | CSLA Namespace


NotUndoableAttribute Class

Allows us to mark fields that should not be copied as part of the undo process

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

System.Object
Attribute
NotUndoableAttribute

[Visual Basic]
Public Class NotUndoableAttribute
Inherits Attribute
[C#]
public class NotUndoableAttribute : Attribute

Remarks

Marking a variable with this attribute will cause the n-level undo process to ignore that variable's value. The value will not be included in a snapshot when BeginEdit is called, nor will it be restored when CancelEdit is called.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

NotUndoableAttribute Members | CSLA Namespace


NotUndoableAttribute Members

Public Instance Constructors

NotUndoableAttribute Constructor Initializes a new instance of the NotUndoableAttribute class.

Public Instance Properties

TypeId (inherited from Attribute) When implemented in a derived class, gets a unique identifier for this Attribute.

Public Instance Methods

Equals (inherited from Attribute) |
GetHashCode (inherited from Attribute) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IsDefaultAttribute (inherited from Attribute) | When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
Match (inherited from Attribute) | When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

NotUndoableAttribute Class | CSLA Namespace


NotUndoableAttribute Constructor

Initializes a new instance of the NotUndoableAttribute class.

[Visual Basic]
Public Sub New()
[C#]
public NotUndoableAttribute();

See Also

NotUndoableAttribute Class | NotUndoableAttribute Members | CSLA Namespace


ReadOnlyBase Class

This is a base class from which readonly business classes can be derived.

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

System.Object
ReadOnlyBase

[Visual Basic]
MustInherit Public Class ReadOnlyBase
Implements ICloneable, ISerializationNotification
[C#]
public abstract class ReadOnlyBase : ICloneable, ISerializationNotification

Remarks

This base class only supports data retrieve, not updating or deleting. Any business classes derived from this base class should only implement readonly properties.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase Members

Public Instance Constructors

ReadOnlyBase Constructor Initializes a new instance of the ReadOnlyBase class.

Public Instance Methods

Clone | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

See Also

ReadOnlyBase Class | CSLA Namespace


ReadOnlyBase Constructor

Initializes a new instance of the ReadOnlyBase class.

[Visual Basic]
Public Sub New()
[C#]
public ReadOnlyBase();

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase Methods

The methods of the ReadOnlyBase class are listed below. For a complete list of ReadOnlyBase class members, see the ReadOnlyBase Members topic.

Public Instance Methods

Clone | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

See Also

ReadOnlyBase Class | CSLA Namespace


ReadOnlyBase.Clone Method

Creates a clone of the object.

[Visual Basic]
NotOverridable Public Function Clone() As Object Implements _
   ICloneable.Clone
[C#]
public object Clone();

Return Value

A new object containing the exact data of the original object.

Implements

ICloneable.Clone

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase.DataPortal_Fetch Method

Override this method to allow retrieval of an existing business object based on data in the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Fetch( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Fetch(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase.DB Method

Returns the specified database connection string from the application configuration file.

[Visual Basic]
Protected Function DB( _
   ByVal DatabaseName As String _
) As String
[C#]
protected string DB(
string DatabaseName
);

Parameters

DatabaseName
Name of the database.

Return Value

A database connection string.

Remarks

The database connection string must be in the appSettings section of the application configuration file. The database name should be prefixed with 'DB:'. For instance, DB:mydatabase.

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase.Deserialized Method

This method is called on a newly deserialized object after deserialization is complete.

[Visual Basic]
Overridable Protected Sub Deserialized() Implements _
   ISerializationNotification.Deserialized
[C#]
protected virtual void Deserialized();

Implements

ISerializationNotification.Deserialized

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase.Serialized Method

This method is called on the original instance of the object after it has been serialized.

[Visual Basic]
Overridable Protected Sub Serialized() Implements _
   ISerializationNotification.Serialized
[C#]
protected virtual void Serialized();

Implements

ISerializationNotification.Serialized

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyBase.Serializing Method

This method is called before an object is serialized.

[Visual Basic]
Overridable Protected Sub Serializing() Implements _
   ISerializationNotification.Serializing
[C#]
protected virtual void Serializing();

Implements

ISerializationNotification.Serializing

See Also

ReadOnlyBase Class | ReadOnlyBase Members | CSLA Namespace


ReadOnlyCollectionBase Class

This is the base class from which readonly collections of readonly objects should be derived.

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

System.Object
CollectionBase
BindableCollectionBase
SortableCollectionBase
ReadOnlyCollectionBase

[Visual Basic]
MustInherit Public Class ReadOnlyCollectionBase
Inherits SortableCollectionBase
Implements ICloneable, ISerializationNotification
[C#]
public abstract class ReadOnlyCollectionBase : SortableCollectionBase, ICloneable, ISerializationNotification

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase Members

Public Instance Constructors

ReadOnlyCollectionBase Constructor Creates a new ReadOnlyCollectionBase object.

Public Instance Properties

Count (inherited from CollectionBase) Gets the number of elements contained in the CollectionBase instance.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Clone | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ListChanged (inherited from BindableCollectionBase) Declares a serialization-safe ListChanged event.

Protected Instance Fields

AllowEdit (inherited from BindableCollectionBase) | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind (inherited from BindableCollectionBase) | Set this to True to allow this collection to be searched.
AllowNew (inherited from BindableCollectionBase) | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove (inherited from BindableCollectionBase) | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort (inherited from BindableCollectionBase) | Set this to True to allow this collection to be sorted.
Locked | Indicates that the collection is locked, so insert, remove and change operations are disallowed.

Protected Instance Properties

ActivelySorting (inherited from SortableCollectionBase) | Indicates whether the collection is in the process of being sorted at this time.
IBindingList_IsSorted (inherited from SortableCollectionBase) | Returns a value indicating whether the collection is currently sorted.
IBindingList_SortDirection (inherited from SortableCollectionBase) | Returns the current sort direction.
IBindingList_SortProperty (inherited from SortableCollectionBase) | Returns the property by which the collection is currently sorted.
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort (inherited from SortableCollectionBase) | Applies a sort to the collection.
IBindingList_Find (inherited from SortableCollectionBase) | Implements search/find functionality for the collection.
IBindingList_RemoveSort (inherited from SortableCollectionBase) | Removes any sort from the collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear | Prevents clearing the collection when the collection is locked.
OnClearComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as the list is cleared.
OnInsert | Prevents insertion of new items into the collection when the collection is locked.
OnInsertComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as a new item is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove | Prevents removal of items from the collection when the collection is locked.
OnRemoveComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as an item is removed.
OnSet | Prevents changing an item reference when the collection is locked.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

ReadOnlyCollectionBase Class | CSLA Namespace


ReadOnlyCollectionBase Constructor

Creates a new ReadOnlyCollectionBase object.

[Visual Basic]
Public Sub New()
[C#]
public ReadOnlyCollectionBase();

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase Fields

The fields of the ReadOnlyCollectionBase class are listed below. For a complete list of ReadOnlyCollectionBase class members, see the ReadOnlyCollectionBase Members topic.

Protected Instance Fields

AllowEdit (inherited from BindableCollectionBase) | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind (inherited from BindableCollectionBase) | Set this to True to allow this collection to be searched.
AllowNew (inherited from BindableCollectionBase) | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove (inherited from BindableCollectionBase) | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort (inherited from BindableCollectionBase) | Set this to True to allow this collection to be sorted.
Locked | Indicates that the collection is locked, so insert, remove and change operations are disallowed.

See Also

ReadOnlyCollectionBase Class | CSLA Namespace


ReadOnlyCollectionBase.Locked Field

Indicates that the collection is locked, so insert, remove and change operations are disallowed.

[Visual Basic]
Protected Locked As Boolean
[C#]
protected bool Locked;

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase Methods

The methods of the ReadOnlyCollectionBase class are listed below. For a complete list of ReadOnlyCollectionBase class members, see the ReadOnlyCollectionBase Members topic.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Clone | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

DataPortal_Fetch | Override this method to allow retrieval of an existing business object based on data in the database.
DB | Returns the specified database connection string from the application configuration file.
Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort (inherited from SortableCollectionBase) | Applies a sort to the collection.
IBindingList_Find (inherited from SortableCollectionBase) | Implements search/find functionality for the collection.
IBindingList_RemoveSort (inherited from SortableCollectionBase) | Removes any sort from the collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear | Prevents clearing the collection when the collection is locked.
OnClearComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as the list is cleared.
OnInsert | Prevents insertion of new items into the collection when the collection is locked.
OnInsertComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as a new item is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove | Prevents removal of items from the collection when the collection is locked.
OnRemoveComplete (inherited from SortableCollectionBase) | Ensures that any sort is maintained as an item is removed.
OnSet | Prevents changing an item reference when the collection is locked.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

ReadOnlyCollectionBase Class | CSLA Namespace


ReadOnlyCollectionBase.Clone Method

Creates a clone of the object.

[Visual Basic]
NotOverridable Public Function Clone() As Object Implements _
   ICloneable.Clone
[C#]
public object Clone();

Return Value

A new object containing the exact data of the original object.

Implements

ICloneable.Clone

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.DataPortal_Fetch Method

Override this method to allow retrieval of an existing business object based on data in the database.

[Visual Basic]
Overridable Protected Sub DataPortal_Fetch( _
   ByVal Criteria As Object _
)
[C#]
protected virtual void DataPortal_Fetch(
object Criteria
);

Parameters

Criteria
An object containing criteria values to identify the object.

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.DB Method

Returns the specified database connection string from the application configuration file.

[Visual Basic]
Protected Function DB( _
   ByVal DatabaseName As String _
) As String
[C#]
protected string DB(
string DatabaseName
);

Parameters

DatabaseName
Name of the database.

Return Value

A database connection string.

Remarks

The database connection string must be in the appSettings section of the application configuration file. The database name should be prefixed with 'DB:'. For instance, DB:mydatabase.

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.Deserialized Method

This method is called on a newly deserialized object after deserialization is complete.

[Visual Basic]
Overridable Protected Sub Deserialized() Implements _
   ISerializationNotification.Deserialized
[C#]
protected virtual void Deserialized();

Implements

ISerializationNotification.Deserialized

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.OnClear Method

Prevents clearing the collection when the collection is locked.

[Visual Basic]
Overrides Protected Sub OnClear()
[C#]
protected override void OnClear();

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.OnInsert Method

Prevents insertion of new items into the collection when the collection is locked.

[Visual Basic]
Overrides Protected Sub OnInsert( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnInsert(
int index,
object value
);

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.OnRemove Method

Prevents removal of items from the collection when the collection is locked.

[Visual Basic]
Overrides Protected Sub OnRemove( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnRemove(
int index,
object value
);

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.OnSet Method

Prevents changing an item reference when the collection is locked.

[Visual Basic]
Overrides Protected Sub OnSet( _
   ByVal index As Integer, _
   ByVal oldValue As Object, _
   ByVal newValue As Object _
)
[C#]
protected override void OnSet(
int index,
object oldValue,
object newValue
);

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.Serialized Method

This method is called on the original instance of the object after it has been serialized.

[Visual Basic]
Overridable Protected Sub Serialized() Implements _
   ISerializationNotification.Serialized
[C#]
protected virtual void Serialized();

Implements

ISerializationNotification.Serialized

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


ReadOnlyCollectionBase.Serializing Method

This method is called before an object is serialized.

[Visual Basic]
Overridable Protected Sub Serializing() Implements _
   ISerializationNotification.Serializing
[C#]
protected virtual void Serializing();

Implements

ISerializationNotification.Serializing

See Also

ReadOnlyCollectionBase Class | ReadOnlyCollectionBase Members | CSLA Namespace


RunLocalAttribute Class

Allows us to mark DataPortal_xxx methods to be run on the client even if the server-side DataPortal is configured for remote use.

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

System.Object
Attribute
RunLocalAttribute

[Visual Basic]
Public Class RunLocalAttribute
Inherits Attribute
[C#]
public class RunLocalAttribute : Attribute

Remarks

The primary purpose for this attribute is to mark DataPortal_Create to run locally in the case where we don't need to load default values from the database as the object is being created.

By running DataPortal_Create locally we avoid all the network overhead of going to the server for no purpose.

Note that if you DO need to actually interact with the database in your DataPortal_xxx method you SHOULD NOT apply this attribute to your DataPortal_xxx method!

Also note that if you apply this attribute and the Transactional attribute to the same method, you MUST register the ServicedDataPortal DLL with COM+ on the client machine or you'll get a runtime failure. The exception to this is if the user is an administrator on the client machine, in which case Enterprise Services will automatically register the DLL with COM+.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

RunLocalAttribute Members | CSLA Namespace


RunLocalAttribute Members

Public Instance Constructors

RunLocalAttribute Constructor Initializes a new instance of the RunLocalAttribute class.

Public Instance Properties

TypeId (inherited from Attribute) When implemented in a derived class, gets a unique identifier for this Attribute.

Public Instance Methods

Equals (inherited from Attribute) |
GetHashCode (inherited from Attribute) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IsDefaultAttribute (inherited from Attribute) | When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
Match (inherited from Attribute) | When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

RunLocalAttribute Class | CSLA Namespace


RunLocalAttribute Constructor

Initializes a new instance of the RunLocalAttribute class.

[Visual Basic]
Public Sub New()
[C#]
public RunLocalAttribute();

See Also

RunLocalAttribute Class | RunLocalAttribute Members | CSLA Namespace


SmartDate Class

Provides a date data type that understands the concept of an empty date value.

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

System.Object
SmartDate

[Visual Basic]
NotInheritable Public Class SmartDate
Implements IComparable
[C#]
public sealed class SmartDate : IComparable

Remarks

See Chapter 5 for a full discussion of the need for this data type and the design choices behind it.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

SmartDate Members | CSLA Namespace


SmartDate Members

Public Static (Shared) Methods

DateToString | Overloaded. Converts a date value into a text representation.
Equals | Returns True if the objects are equal.
StringToDate | Overloaded. Converts a text date representation into a Date value.

Public Instance Constructors

SmartDate Overloaded. Initialize a new instance of the SmartDate class.

Public Instance Properties

Date | Gets or sets the date value.
DBValue | Gets a database-friendly version of the date value.
EmptyIsMin | Indicates whether an empty date is the min or max possible date value.
FormatString | Gets or sets the format string used to format a date value when it is returned as text.
IsEmpty | Indicates whether this object contains an empty date.
Text | Gets or sets the date value.

Public Instance Methods

Add | Adds a TimeSpan onto the object.
CompareTo | Overloaded. Compares one SmartDate to another.
Equals | Overloaded. Returns True if the object is equal to this SmartDate.
GetHashCode | Returns a hash code for this object.
GetType (inherited from Object) | Gets the Type of the current instance.
Subtract | Subtracts a TimeSpan from the object.
ToString | Returns a text representation of the date value.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SmartDate Class | CSLA Namespace


SmartDate Constructor

Creates a new SmartDate object.

Overload List

Creates a new SmartDate object.

public SmartDate();

Creates a new SmartDate object.

public SmartDate(bool);

Creates a new SmartDate object.

public SmartDate(DateTime);

Creates a new SmartDate object.

public SmartDate(DateTime,bool);

Creates a new SmartDate object.

public SmartDate(string);

Creates a new SmartDate object.

public SmartDate(string,bool);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate Constructor ()

Creates a new SmartDate object.

[Visual Basic]
Overloads Public Sub New()
[C#]
public SmartDate();

Remarks

The SmartDate created will use the min possible date to represent an empty date.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate Constructor Overload List


SmartDate Constructor (Boolean)

Creates a new SmartDate object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal EmptyIsMin As Boolean _
)
[C#]
public SmartDate(
bool EmptyIsMin
);

Parameters

EmptyIsMin
Indicates whether an empty date is the min or max date value.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate Constructor Overload List


SmartDate Constructor (DateTime)

Creates a new SmartDate object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal Value As Date _
)
[C#]
public SmartDate(
DateTime Value
);

Parameters

Value
The initial value of the object.

Remarks

The SmartDate created will use the min possible date to represent an empty date.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate Constructor Overload List


SmartDate Constructor (DateTime, Boolean)

Creates a new SmartDate object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal Value As Date, _
   ByVal EmptyIsMin As Boolean _
)
[C#]
public SmartDate(
DateTime Value,
bool EmptyIsMin
);

Parameters

Value
The initial value of the object.
EmptyIsMin
Indicates whether an empty date is the min or max date value.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate Constructor Overload List


SmartDate Constructor (String)

Creates a new SmartDate object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal Value As String _
)
[C#]
public SmartDate(
string Value
);

Parameters

Value
The initial value of the object (as text).

Remarks

The SmartDate created will use the min possible date to represent an empty date.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate Constructor Overload List


SmartDate Constructor (String, Boolean)

Creates a new SmartDate object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal Value As String, _
   ByVal EmptyIsMin As Boolean _
)
[C#]
public SmartDate(
string Value,
bool EmptyIsMin
);

Parameters

Value
The initial value of the object (as text).
EmptyIsMin
Indicates whether an empty date is the min or max date value.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate Constructor Overload List


SmartDate Properties

The properties of the SmartDate class are listed below. For a complete list of SmartDate class members, see the SmartDate Members topic.

Public Instance Properties

Date | Gets or sets the date value.
DBValue | Gets a database-friendly version of the date value.
EmptyIsMin | Indicates whether an empty date is the min or max possible date value.
FormatString | Gets or sets the format string used to format a date value when it is returned as text.
IsEmpty | Indicates whether this object contains an empty date.
Text | Gets or sets the date value.

See Also

SmartDate Class | CSLA Namespace


SmartDate.Date Property

Gets or sets the date value.

[Visual Basic]
Public Property Date As Date
[C#]
public System.DateTime Date {get; set;}

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.DBValue Property

Gets a database-friendly version of the date value.

[Visual Basic]
Public ReadOnly Property DBValue As Object
[C#]
public object DBValue {get;}

Remarks

If the SmartDate contains an empty date, this returns DBNull. Otherwise the actual date value is returned as type Date.

This property is very useful when setting parameter values for a Command object, since it automatically stores null values into the database for empty date values.

When you also use the SafeDataReader and its GetSmartDate method, you can easily read a null value from the database back into a SmartDate object so it remains considered as an empty date value.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.EmptyIsMin Property

Indicates whether an empty date is the min or max possible date value.

[Visual Basic]
Public ReadOnly Property EmptyIsMin As Boolean
[C#]
public bool EmptyIsMin {get;}

Remarks

Whether an empty date is considered to be the smallest or largest possible date is only important for comparison operations. This allows you to compare an empty date with a real date and get a meaningful result.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.FormatString Property

Gets or sets the format string used to format a date value when it is returned as text.

[Visual Basic]
Public Property FormatString As String
[C#]
public string FormatString {get; set;}

Property Value

A format string.

Remarks

The format string should follow the requirements for the Visual Basic .NET Format() statement.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.IsEmpty Property

Indicates whether this object contains an empty date.

[Visual Basic]
Public ReadOnly Property IsEmpty As Boolean
[C#]
public bool IsEmpty {get;}

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.Text Property

Gets or sets the date value.

[Visual Basic]
Public Property Text As String
[C#]
public string Text {get; set;}

Remarks

This property can be used to set the date value by passing a text representation of the date. Any text date representation that can be parsed by the .NET runtime is valid.

When the date value is retrieved via this property, the text is formatted by using the format specified by the FormatString property. The default is the "Short Date" format.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate Methods

The methods of the SmartDate class are listed below. For a complete list of SmartDate class members, see the SmartDate Members topic.

Public Static (Shared) Methods

DateToString | Overloaded. Converts a date value into a text representation.
Equals | Returns True if the objects are equal.
StringToDate | Overloaded. Converts a text date representation into a Date value.

Public Instance Methods

Add | Adds a TimeSpan onto the object.
CompareTo | Overloaded. Compares one SmartDate to another.
Equals | Overloaded. Returns True if the object is equal to this SmartDate.
GetHashCode | Returns a hash code for this object.
GetType (inherited from Object) | Gets the Type of the current instance.
Subtract | Subtracts a TimeSpan from the object.
ToString | Returns a text representation of the date value.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SmartDate Class | CSLA Namespace


SmartDate.Add Method

Adds a TimeSpan onto the object.

[Visual Basic]
Public Sub Add( _
   ByVal Value As TimeSpan _
)
[C#]
public void Add(
TimeSpan Value
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


CompareTo Method

CSLA .NET

SmartDate.CompareTo Method

Compares one SmartDate to another.

Overload List

Compares one SmartDate to another.

public int CompareTo(object);

Compares one SmartDate to another.

public int CompareTo(SmartDate);

Compares a SmartDate to a text date value.

public int CompareTo(string);

Compares a SmartDate to a date value.

public int CompareTo(DateTime);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.CompareTo Method (SmartDate)

Compares one SmartDate to another.

[Visual Basic]
Overloads Public Function CompareTo( _
   ByVal Value As SmartDate _
) As Integer
[C#]
public int CompareTo(
SmartDate Value
);

Parameters

Value
The date to which we are being compared.

Return Value

A value indicating if the comparison date is less than, equal to or greater than this date.

Remarks

This method works the same as the CompareTo method on the Date datetype, with the exception that it understands the concept of empty date values.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.CompareTo Overload List


SmartDate.CompareTo Method (DateTime)

Compares a SmartDate to a date value.

[Visual Basic]
Overloads Public Function CompareTo( _
   ByVal Value As Date _
) As Integer
[C#]
public int CompareTo(
DateTime Value
);

Parameters

Value
The date to which we are being compared.

Return Value

A value indicating if the comparison date is less than, equal to or greater than this date.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.CompareTo Overload List


SmartDate.CompareTo Method (Object)

Compares one SmartDate to another.

[Visual Basic]
NotOverridable Overloads Public Function CompareTo( _
   ByVal Value As Object _
) As Integer Implements _
   IComparable.CompareTo
[C#]
public int CompareTo(
object Value
);

Parameters

Value
The date to which we are being compared.

Return Value

A value indicating if the comparison date is less than, equal to or greater than this date.

Implements

IComparable.CompareTo

Remarks

This method works the same as the CompareTo method on the Date datetype, with the exception that it understands the concept of empty date values.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.CompareTo Overload List


SmartDate.CompareTo Method (String)

Compares a SmartDate to a text date value.

[Visual Basic]
Overloads Public Function CompareTo( _
   ByVal Value As String _
) As Integer
[C#]
public int CompareTo(
string Value
);

Parameters

Value
The date to which we are being compared.

Return Value

A value indicating if the comparison date is less than, equal to or greater than this date.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.CompareTo Overload List


DateToString Method

CSLA .NET

SmartDate.DateToString Method

Converts a date value into a text representation.

Overload List

Converts a date value into a text representation.

public static string DateToString(DateTime,string);

Converts a date value into a text representation.

public static string DateToString(DateTime,string,bool);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.DateToString Method (DateTime, String)

Converts a date value into a text representation.

[Visual Basic]
Overloads Public Shared Function DateToString( _
   ByVal Value As Date, _
   ByVal FormatString As String _
) As String
[C#]
public static string DateToString(
DateTime Value,
string FormatString
);

Parameters

Value
The date value to convert.
FormatString
The format string used to format the date into text.

Return Value

Text representation of the date value.

Remarks

The date is considered empty if it matches the min value for the Date datatype. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.DateToString Overload List


SmartDate.DateToString Method (DateTime, String, Boolean)

Converts a date value into a text representation.

[Visual Basic]
Overloads Public Shared Function DateToString( _
   ByVal Value As Date, _
   ByVal FormatString As String, _
   ByVal EmptyIsMin As Boolean _
) As String
[C#]
public static string DateToString(
DateTime Value,
string FormatString,
bool EmptyIsMin
);

Parameters

Value
The date value to convert.
FormatString
The format string used to format the date into text.
EmptyIsMin
Indicates whether an empty date is the min or max date value.

Return Value

Text representation of the date value.

Remarks

Whether the date value is considered empty is determined by the EmptyIsMin parameter value. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.DateToString Overload List


Equals Method

CSLA .NET

SmartDate.Equals Method

Returns True if the SmartDate is equal to this SmartDate.

Overload List

Returns True if the object is equal to this SmartDate.

public override bool Equals(object);

Returns True if the objects are equal.

new public static bool Equals(object,object);

Returns True if the SmartDate is equal to this SmartDate.

public bool Equals(SmartDate);

Returns True if the date is equal to this SmartDate.

public bool Equals(DateTime);

Returns True if the text (as a date) is equal to this SmartDate.

public bool Equals(string);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.Equals Method (SmartDate)

Returns True if the SmartDate is equal to this SmartDate.

[Visual Basic]
Overloads Public Function Equals( _
   ByVal obj As SmartDate _
) As Boolean
[C#]
public bool Equals(
SmartDate obj
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.Equals Overload List


SmartDate.Equals Method (DateTime)

Returns True if the date is equal to this SmartDate.

[Visual Basic]
Overloads Public Function Equals( _
   ByVal obj As Date _
) As Boolean
[C#]
public bool Equals(
DateTime obj
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.Equals Overload List


SmartDate.Equals Method (Object)

Returns True if the object is equal to this SmartDate.

[Visual Basic]
Overrides Overloads Public Function Equals( _
   ByVal obj As Object _
) As Boolean
[C#]
public override bool Equals(
object obj
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.Equals Overload List


SmartDate.Equals Method (Object, Object)

Returns True if the objects are equal.

[Visual Basic]
Overloads Public Shared Function Equals( _
   ByVal objA As Object, _
   ByVal objB As Object _
) As Boolean
[C#]
new public static bool Equals(
object objA,
object objB
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.Equals Overload List


SmartDate.Equals Method (String)

Returns True if the text (as a date) is equal to this SmartDate.

[Visual Basic]
Overloads Public Function Equals( _
   ByVal obj As String _
) As Boolean
[C#]
public bool Equals(
string obj
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.Equals Overload List


SmartDate.GetHashCode Method

Returns a hash code for this object.

[Visual Basic]
Overrides Public Function GetHashCode() As Integer
[C#]
public override int GetHashCode();

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


StringToDate Method

CSLA .NET

SmartDate.StringToDate Method

Converts a text date representation into a Date value.

Overload List

Converts a text date representation into a Date value.

public static DateTime StringToDate(string);

Converts a text date representation into a Date value.

public static DateTime StringToDate(string,bool);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.StringToDate Method (String)

Converts a text date representation into a Date value.

[Visual Basic]
Overloads Public Shared Function StringToDate( _
   ByVal Value As String _
) As Date
[C#]
public static DateTime StringToDate(
string Value
);

Parameters

Value
The text representation of the date.

Return Value

A Date value.

Remarks

An empty string is assumed to represent an empty date. An empty date is returned as the MinValue of the Date datatype.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.StringToDate Overload List


SmartDate.StringToDate Method (String, Boolean)

Converts a text date representation into a Date value.

[Visual Basic]
Overloads Public Shared Function StringToDate( _
   ByVal Value As String, _
   ByVal EmptyIsMin As Boolean _
) As Date
[C#]
public static DateTime StringToDate(
string Value,
bool EmptyIsMin
);

Parameters

Value
The text representation of the date.
EmptyIsMin
Indicates whether an empty date is the min or max date value.

Return Value

A Date value.

Remarks

An empty string is assumed to represent an empty date. An empty date is returned as the MinValue or MaxValue of the Date datatype depending on the EmptyIsMin parameter.

See Also

SmartDate Class | SmartDate Members | CSLA Namespace | SmartDate.StringToDate Overload List


SmartDate.Subtract Method

Subtracts a TimeSpan from the object.

[Visual Basic]
Public Sub Subtract( _
   ByVal Value As TimeSpan _
)
[C#]
public void Subtract(
TimeSpan Value
);

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


SmartDate.ToString Method

Returns a text representation of the date value.

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

See Also

SmartDate Class | SmartDate Members | CSLA Namespace


TransactionalAttribute Class

Allows us to mark the DataPortal_xxx methods in our business classes as transactional.

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

System.Object
Attribute
TransactionalAttribute

[Visual Basic]
Public Class TransactionalAttribute
Inherits Attribute
[C#]
public class TransactionalAttribute : Attribute

Remarks

When a method is marked as transactional, the DataPortal mechanism runs the method within a COM+ transactional context, so the data access is protected by a 2-phase distributed transaction.

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

TransactionalAttribute Members | CSLA Namespace


TransactionalAttribute Members

Public Instance Constructors

TransactionalAttribute Constructor Initializes a new instance of the TransactionalAttribute class.

Public Instance Properties

TypeId (inherited from Attribute) When implemented in a derived class, gets a unique identifier for this Attribute.

Public Instance Methods

Equals (inherited from Attribute) |
GetHashCode (inherited from Attribute) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
IsDefaultAttribute (inherited from Attribute) | When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
Match (inherited from Attribute) | When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TransactionalAttribute Class | CSLA Namespace


TransactionalAttribute Constructor

Initializes a new instance of the TransactionalAttribute class.

[Visual Basic]
Public Sub New()
[C#]
public TransactionalAttribute();

See Also

TransactionalAttribute Class | TransactionalAttribute Members | CSLA Namespace


ValidationException Class

Exception class indicating that there was a validation problem with a business object.

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

System.Object
Exception
ApplicationException
ValidationException

[Visual Basic]
Public Class ValidationException
Inherits ApplicationException
[C#]
public class ValidationException : ApplicationException

Requirements

Namespace: CSLA Namespace

Assembly: CSLA.dll

See Also

ValidationException Members | CSLA Namespace


ValidationException Members

Public Instance Constructors

ValidationException Overloaded. Initialize a new instance of the ValidationException class.

Public Instance Properties

HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message (inherited from Exception) | Gets a message that describes the current exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Constructors

ValidationException Overloaded. Initialize a new instance of the ValidationException class.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ValidationException Class | CSLA Namespace


ValidationException Constructor

Initializes a new instance of the ValidationException class.

Overload List

Initializes a new instance of the ValidationException class.

public ValidationException();

Initializes a new instance of the ValidationException class with a specified error message.

public ValidationException(string);

Initializes a new instance of the ValidationException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public ValidationException(string,Exception);

Initializes a new instance of the ValidationException class with serialized data.

protected ValidationException(SerializationInfo,StreamingContext);

See Also

ValidationException Class | ValidationException Members | CSLA Namespace


ValidationException Constructor ()

Initializes a new instance of the ValidationException class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public ValidationException();

See Also

ValidationException Class | ValidationException Members | CSLA Namespace | ValidationException Constructor Overload List


ValidationException Constructor (String)

Initializes a new instance of the ValidationException class with a specified error message.

[Visual Basic]
Overloads Public Sub New( _
   ByVal message As String _
)
[C#]
public ValidationException(
string message
);

See Also

ValidationException Class | ValidationException Members | CSLA Namespace | ValidationException Constructor Overload List


ValidationException Constructor (String, Exception)

Initializes a new instance of the ValidationException class with a specified error message and a reference to the inner exception that is the cause of this exception.

[Visual Basic]
Overloads Public Sub New( _
   ByVal message As String, _
   ByVal innerException As Exception _
)
[C#]
public ValidationException(
string message,
Exception innerException
);

See Also

ValidationException Class | ValidationException Members | CSLA Namespace | ValidationException Constructor Overload List


ValidationException Constructor (SerializationInfo, StreamingContext)

Initializes a new instance of the ValidationException class with serialized data.

[Visual Basic]
Overloads Protected Sub New( _
   ByVal info As SerializationInfo, _
   ByVal context As StreamingContext _
)
[C#]
protected ValidationException(
SerializationInfo info,
StreamingContext context
);

See Also

ValidationException Class | ValidationException Members | CSLA Namespace | ValidationException Constructor Overload List


CSLA.BatchQueue

CSLA .NET

CSLA.BatchQueue Namespace

Namespace hierarchy

Classes

Class | Description
BatchEntries | Contains a list of holding, pending and active batch queue entries.
BatchEntryInfo | Contains information about a batch queue entry.
BatchJobRequest | A helper object used to execute a specified class from a specified DLL on the server.
BatchQueue | Provides easy access to the batch queue functionality.

Interfaces

Interface | Description
IBatchEntry | Defines the interface that must be implemented by all worker classes.

Enumerations

Enumeration | Description
BatchEntryStatus | Values indicating the status of a batch queue entry.


BatchEntries Class

Contains a list of holding, pending and active batch queue entries.

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

System.Object
CollectionBase
BatchEntries

[Visual Basic]
Public Class BatchEntries
Inherits CollectionBase
[C#]
public class BatchEntries : CollectionBase

Requirements

Namespace: CSLA.BatchQueue Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchEntries Members | CSLA.BatchQueue Namespace


BatchEntries Members

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
Entry | Overloaded. Returns a reference to an object with information about a specific batch queue entry.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Properties

InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete (inherited from CollectionBase) | Performs additional custom processes after clearing the contents of the CollectionBase instance.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete (inherited from CollectionBase) | Performs additional custom processes after inserting a new element into the CollectionBase instance.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete (inherited from CollectionBase) | Performs additional custom processes after removing an element from the CollectionBase instance.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from CollectionBase) | Performs additional custom processes after setting a value in the CollectionBase instance.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BatchEntries Class | CSLA.BatchQueue Namespace


BatchEntries Properties

The properties of the BatchEntries class are listed below. For a complete list of BatchEntries class members, see the BatchEntries Members topic.

Public Instance Properties

Count (inherited from CollectionBase) | Gets the number of elements contained in the CollectionBase instance.
Entry | Overloaded. Returns a reference to an object with information about a specific batch queue entry.

Protected Instance Properties

InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

See Also

BatchEntries Class | CSLA.BatchQueue Namespace


Entry Property

CSLA .NET

BatchEntries.Entry Property

Overload List

Returns a reference to an object with information about a specific batch queue entry.

public BatchEntryInfo this[int] {get;}

public BatchEntryInfo this[System.Guid] {get;}

See Also

BatchEntries Class | BatchEntries Members | CSLA.BatchQueue Namespace


BatchEntries.Entry Property

[Visual Basic]
Overloads Public Default ReadOnly Property Entry( _
ByVal ID As Guid _
) As BatchEntryInfo
[C#]
public BatchEntryInfo this[
System.Guid ID
] {get;}

See Also

BatchEntries Class | BatchEntries Members | CSLA.BatchQueue Namespace | BatchEntries.Entry Overload List


BatchEntries.Entry Property

Returns a reference to an object with information about a specific batch queue entry.

[Visual Basic]
Overloads Public Default ReadOnly Property Entry( _
ByVal index As Integer _
) As BatchEntryInfo
[C#]
public BatchEntryInfo this[
int index
] {get;}

See Also

BatchEntries Class | BatchEntries Members | CSLA.BatchQueue Namespace | BatchEntries.Entry Overload List


BatchEntryInfo Class

Contains information about a batch queue entry.

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

System.Object
BatchEntryInfo

[Visual Basic]
Public Class BatchEntryInfo
[C#]
public class BatchEntryInfo

Remarks

This object contains information about batch entry including when it was submitted, the user that submitted the job and which machine the user was using at the time. It also contains the job's priority, status and the optional date/time until which the job should be held until it is run.

Requirements

Namespace: CSLA.BatchQueue Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo Members

Public Instance Constructors

BatchEntryInfo Constructor Initializes a new instance of the BatchEntryInfo class.

Public Instance Properties

HoldUntil | Returns the date and time until which the batch entry will be held before it can be run.
ID | Returns the unique ID value for this batch entry.
Machine | Returns the name of the workstation from which this job was submitted.
MessageID | Returns the MSMQ message ID of the batch entry.
Priority | Returns the priority of this batch entry.
Status | Returns the status of the batch entry.
Submitted | Returns the date and time that the batch entry was submitted.
User | Returns the Windows user id of the user that was logged into the workstation when the job was submitted.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode |
GetType (inherited from Object) | Gets the Type of the current instance.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchEntryInfo Class | CSLA.BatchQueue Namespace


BatchEntryInfo Constructor

Initializes a new instance of the BatchEntryInfo class.

[Visual Basic]
Public Sub New()
[C#]
public BatchEntryInfo();

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo Properties

The properties of the BatchEntryInfo class are listed below. For a complete list of BatchEntryInfo class members, see the BatchEntryInfo Members topic.

Public Instance Properties

HoldUntil | Returns the date and time until which the batch entry will be held before it can be run.
ID | Returns the unique ID value for this batch entry.
Machine | Returns the name of the workstation from which this job was submitted.
MessageID | Returns the MSMQ message ID of the batch entry.
Priority | Returns the priority of this batch entry.
Status | Returns the status of the batch entry.
Submitted | Returns the date and time that the batch entry was submitted.
User | Returns the Windows user id of the user that was logged into the workstation when the job was submitted.

See Also

BatchEntryInfo Class | CSLA.BatchQueue Namespace


BatchEntryInfo.HoldUntil Property

Returns the date and time until which the batch entry will be held before it can be run.

[Visual Basic]
Public Property HoldUntil As Date
[C#]
public System.DateTime HoldUntil {get; set;}

Remarks

This value is optional. If it was provided, the batch entry will be held until this date/time. At this date/time, the entry will switch from Holding status to Pending status and will be queued based on its priority along with all other Pending entries.

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.ID Property

Returns the unique ID value for this batch entry.

[Visual Basic]
Public ReadOnly Property ID As Guid
[C#]
public System.Guid ID {get;}

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.Machine Property

Returns the name of the workstation from which this job was submitted.

[Visual Basic]
Public ReadOnly Property Machine As String
[C#]
public string Machine {get;}

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.MessageID Property

Returns the MSMQ message ID of the batch entry.

[Visual Basic]
Public ReadOnly Property MessageID As String
[C#]
public string MessageID {get;}

Remarks

This value is only valid after the batch entry has been submitted to the queue.

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.Priority Property

Returns the priority of this batch entry.

[Visual Basic]
Public Property Priority As MessagePriority
[C#]
public System.Messaging.MessagePriority Priority {get; set;}

Remarks

The priority values flow from System.Messaging and the priority is used by MSMQ to order the entries in the queue.

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.Status Property

Returns the status of the batch entry.

[Visual Basic]
Public ReadOnly Property Status As BatchEntryStatus
[C#]
public BatchEntryStatus Status {get;}

Remarks

If the job is Holding, it means that the job won't run until the data/time specified by HoldUntil.

If the job is Pending, it means that the job will run as soon as possible, but that the queue is busy. Pending entries are run in priority order based on Priority.

If the job is Active, it means that the job is currently being executed on the server.

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.Submitted Property

Returns the date and time that the batch entry was submitted.

[Visual Basic]
Public ReadOnly Property Submitted As Date
[C#]
public System.DateTime Submitted {get;}

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.User Property

Returns the Windows user id of the user that was logged into the workstation when the job was submitted.

[Visual Basic]
Public ReadOnly Property User As String
[C#]
public string User {get;}

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo Methods

The methods of the BatchEntryInfo class are listed below. For a complete list of BatchEntryInfo class members, see the BatchEntryInfo Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode |
GetType (inherited from Object) | Gets the Type of the current instance.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchEntryInfo Class | CSLA.BatchQueue Namespace


Equals Method

CSLA .NET

BatchEntryInfo.Equals Method

Overload List

Inherited from Object.

public virtual bool Equals(object);

public bool Equals(BatchEntryInfo);

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.Equals Method (BatchEntryInfo)

[Visual Basic]
Overloads Public Function Equals( _
   ByVal Info As BatchEntryInfo _
) As Boolean
[C#]
public bool Equals(
BatchEntryInfo Info
);

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace | BatchEntryInfo.Equals Overload List


BatchEntryInfo.GetHashCode Method

[Visual Basic]
Overrides Public Function GetHashCode() As Integer
[C#]
public override int GetHashCode();

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryInfo.ToString Method

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

See Also

BatchEntryInfo Class | BatchEntryInfo Members | CSLA.BatchQueue Namespace


BatchEntryStatus Enumeration

Values indicating the status of a batch queue entry.

[Visual Basic]
Public Enum BatchEntryStatus
[C#]
public enum BatchEntryStatus

Members

Member Name | Description
Pending |
Holding |
Active |

Requirements

Namespace: CSLA.BatchQueue Namespace

Assembly: CSLA.BatchQueue.dll

See Also

CSLA.BatchQueue Namespace


BatchJobRequest Class

A helper object used to execute a specified class from a specified DLL on the server.

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

System.Object
BatchJobRequest

[Visual Basic]
Public Class BatchJobRequest
Implements IBatchEntry
[C#]
public class BatchJobRequest : IBatchEntry

Remarks

A worker object can be provided directly by the client workstation. In that case, the worker object is passed by value to the server where it is executed. The drawback to such an approach is that the worker assembly must be installed on both client and server.

BatchJobRequest is a worker object that specifies the type and assembly name of a class on the server. When this job is run, it dynamically creates an instance of the specified class and executes it on the server. This means that the actual worker assembly needs to be installed only on the server, not on the client.

Requirements

Namespace: CSLA.BatchQueue Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchJobRequest Members | CSLA.BatchQueue Namespace


BatchJobRequest Members

Public Instance Constructors

BatchJobRequest Constructor Creates a new object, specifying the type and assembly of the actual worker object.

Public Instance Properties

Assembly | The name of the assembly containing the actual worker class.
Type | The class name of the worker object.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Execute | Executes the batch job on the server.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchJobRequest Class | CSLA.BatchQueue Namespace


BatchJobRequest Constructor

Creates a new object, specifying the type and assembly of the actual worker object.

[Visual Basic]
Public Sub New( _
   ByVal Type As String, _
   ByVal Assembly As String _
)
[C#]
public BatchJobRequest(
string Type,
string Assembly
);

Parameters

Type
The class name of the actual worker object.
Assembly
The name of the assembly containing the actual worker class.

See Also

BatchJobRequest Class | BatchJobRequest Members | CSLA.BatchQueue Namespace


BatchJobRequest Properties

The properties of the BatchJobRequest class are listed below. For a complete list of BatchJobRequest class members, see the BatchJobRequest Members topic.

Public Instance Properties

Assembly | The name of the assembly containing the actual worker class.
Type | The class name of the worker object.

See Also

BatchJobRequest Class | CSLA.BatchQueue Namespace


BatchJobRequest.Assembly Property

The name of the assembly containing the actual worker class.

[Visual Basic]
Public Property Assembly As String
[C#]
public string Assembly {get; set;}

See Also

BatchJobRequest Class | BatchJobRequest Members | CSLA.BatchQueue Namespace


BatchJobRequest.Type Property

The class name of the worker object.

[Visual Basic]
Public Property Type As String
[C#]
public string Type {get; set;}

See Also

BatchJobRequest Class | BatchJobRequest Members | CSLA.BatchQueue Namespace


BatchJobRequest Methods

The methods of the BatchJobRequest class are listed below. For a complete list of BatchJobRequest class members, see the BatchJobRequest Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Execute | Executes the batch job on the server.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchJobRequest Class | CSLA.BatchQueue Namespace


BatchJobRequest.Execute Method

Executes the batch job on the server.

[Visual Basic]
NotOverridable Public Sub Execute( _
   ByVal State As Object _
) Implements _
   IBatchEntry.Execute
[C#]
public void Execute(
object State
);

Parameters

State

Implements

IBatchEntry.Execute

Remarks

This method runs on the server - it is called by BatchEntry, which is called by BatchQueueService.

See Also

BatchJobRequest Class | BatchJobRequest Members | CSLA.BatchQueue Namespace


BatchJobRequest.ToString Method

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

See Also

BatchJobRequest Class | BatchJobRequest Members | CSLA.BatchQueue Namespace


BatchQueue Class

Provides easy access to the batch queue functionality.

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

System.Object
BatchQueue

[Visual Basic]
Public Class BatchQueue
[C#]
public class BatchQueue

Remarks

Client code should create an instance of this class to interact with a batch queue. A BatchQueue object can be used to interact with either the default batch queue server or with a specific batch queue server.

Requirements

Namespace: CSLA.BatchQueue Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue Members

Public Instance Constructors

BatchQueue Overloaded. Initialize a new instance of the BatchQueue class.

Public Instance Properties

BatchQueueURL | Returns the URL which identifies the batch queue server to which this object is attached.
Entries | Returns a collection of the batch entries currently in the batch queue.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode |
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes a holding or pending entry from the batch queue.
Submit | Overloaded. Submits an entry to the batch queue.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchQueue Class | CSLA.BatchQueue Namespace


BatchQueue Constructor

Creates an instance of the object that allows interaction with the default batch queue server as specified in the application configuration file.

Overload List

Creates an instance of the object that allows interaction with the default batch queue server as specified in the application configuration file.

public BatchQueue();

Creates an instance of the object that allows interaction with a specific batch queue server as specified by the URL passed as a parameter.

public BatchQueue(string);

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue Constructor ()

Creates an instance of the object that allows interaction with the default batch queue server as specified in the application configuration file.

[Visual Basic]
Overloads Public Sub New()
[C#]
public BatchQueue();

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue Constructor Overload List


BatchQueue Constructor (String)

Creates an instance of the object that allows interaction with a specific batch queue server as specified by the URL passed as a parameter.

[Visual Basic]
Overloads Public Sub New( _
   ByVal QueueServerURL As String _
)
[C#]
public BatchQueue(
string QueueServerURL
);

Parameters

QueueServerURL
A URL referencing the batch queue server.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue Constructor Overload List


BatchQueue Properties

The properties of the BatchQueue class are listed below. For a complete list of BatchQueue class members, see the BatchQueue Members topic.

Public Instance Properties

BatchQueueURL | Returns the URL which identifies the batch queue server to which this object is attached.
Entries | Returns a collection of the batch entries currently in the batch queue.

See Also

BatchQueue Class | CSLA.BatchQueue Namespace


BatchQueue.BatchQueueURL Property

Returns the URL which identifies the batch queue server to which this object is attached.

[Visual Basic]
Public ReadOnly Property BatchQueueURL As String
[C#]
public string BatchQueueURL {get;}

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue.Entries Property

Returns a collection of the batch entries currently in the batch queue.

[Visual Basic]
Public ReadOnly Property Entries As BatchEntries
[C#]
public BatchEntries Entries {get;}

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue Methods

The methods of the BatchQueue class are listed below. For a complete list of BatchQueue class members, see the BatchQueue Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode |
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes a holding or pending entry from the batch queue.
Submit | Overloaded. Submits an entry to the batch queue.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchQueue Class | CSLA.BatchQueue Namespace


Equals Method

CSLA .NET

BatchQueue.Equals Method

Overload List

Inherited from Object.

public virtual bool Equals(object);

public bool Equals(BatchQueue);

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue.Equals Method (BatchQueue)

[Visual Basic]
Overloads Public Function Equals( _
   ByVal Queue As BatchQueue _
) As Boolean
[C#]
public bool Equals(
BatchQueue Queue
);

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Equals Overload List


BatchQueue.GetHashCode Method

[Visual Basic]
Overrides Public Function GetHashCode() As Integer
[C#]
public override int GetHashCode();

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue.Remove Method

Removes a holding or pending entry from the batch queue.

[Visual Basic]
Public Sub Remove( _
   ByVal Entry As BatchEntryInfo _
)
[C#]
public void Remove(
BatchEntryInfo Entry
);

Parameters

Entry
A reference to the entry to be removed.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


Submit Method

CSLA .NET

BatchQueue.Submit Method

Submits an entry to the batch queue.

Overload List

Submits an entry to the batch queue.

public void Submit(IBatchEntry);

Submits an entry to the batch queue with extra state data.

public void Submit(IBatchEntry,object);

Submits an entry to the batch queue with a specific priority.

public void Submit(IBatchEntry,MessagePriority);

Submits an entry to the batch queue with extra state data and a specific priority.

public void Submit(IBatchEntry,object,MessagePriority);

Submits an entry to the batch queue to be held until a specific date/time.

public void Submit(IBatchEntry,DateTime);

Submits an entry to the batch queue with extra state data and to be held until a specific date/time.

public void Submit(IBatchEntry,object,DateTime);

Submits an entry to the batch queue to be held until a specific date/time and at a specific priority.

public void Submit(IBatchEntry,DateTime,MessagePriority);

Submits an entry to the batch queue specifying all details.

public void Submit(IBatchEntry,object,DateTime,MessagePriority);

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


BatchQueue.Submit Method (IBatchEntry)

Submits an entry to the batch queue.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry _
)
[C#]
public void Submit(
IBatchEntry Entry
);

Parameters

Entry
A reference to your worker object.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, DateTime)

Submits an entry to the batch queue to be held until a specific date/time.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal HoldUntil As Date _
)
[C#]
public void Submit(
IBatchEntry Entry,
DateTime HoldUntil
);

Parameters

Entry
A reference to your worker object.
HoldUntil
The date/time until which the entry should be held.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, DateTime, MessagePriority)

Submits an entry to the batch queue to be held until a specific date/time and at a specific priority.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal HoldUntil As Date, _
   ByVal Priority As MessagePriority _
)
[C#]
public void Submit(
IBatchEntry Entry,
DateTime HoldUntil,
MessagePriority Priority
);

Parameters

Entry
A reference to your worker object.
HoldUntil
The date/time until which the entry should be held.
Priority
The priority of the entry.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, MessagePriority)

Submits an entry to the batch queue with a specific priority.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal Priority As MessagePriority _
)
[C#]
public void Submit(
IBatchEntry Entry,
MessagePriority Priority
);

Parameters

Entry
A reference to your worker object.
Priority
The priority of the entry.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, Object)

Submits an entry to the batch queue with extra state data.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal State As Object _
)
[C#]
public void Submit(
IBatchEntry Entry,
object State
);

Parameters

Entry
A reference to your worker object.
State
A reference to a serializable object containing state data.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, Object, DateTime)

Submits an entry to the batch queue with extra state data and to be held until a specific date/time.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal State As Object, _
   ByVal HoldUntil As Date _
)
[C#]
public void Submit(
IBatchEntry Entry,
object State,
DateTime HoldUntil
);

Parameters

Entry
A reference to your worker object.
State
A reference to a serializable object containing state data.
HoldUntil
The date/time until which the entry should be held.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, Object, DateTime, MessagePriority)

Submits an entry to the batch queue specifying all details.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal State As Object, _
   ByVal HoldUntil As Date, _
   ByVal Priority As MessagePriority _
)
[C#]
public void Submit(
IBatchEntry Entry,
object State,
DateTime HoldUntil,
MessagePriority Priority
);

Parameters

Entry
A reference to your worker object.
State
A reference to a serializable object containing state data.
HoldUntil
The date/time until which the entry should be held.
Priority
The priority of the entry.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.Submit Method (IBatchEntry, Object, MessagePriority)

Submits an entry to the batch queue with extra state data and a specific priority.

[Visual Basic]
Overloads Public Sub Submit( _
   ByVal Entry As IBatchEntry, _
   ByVal State As Object, _
   ByVal Priority As MessagePriority _
)
[C#]
public void Submit(
IBatchEntry Entry,
object State,
MessagePriority Priority
);

Parameters

Entry
A reference to your worker object.
State
A reference to a serializable object containing state data.
Priority
The priority of the entry.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace | BatchQueue.Submit Overload List


BatchQueue.ToString Method

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue Namespace


IBatchEntry Interface

Defines the interface that must be implemented by all worker classes.

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

[Visual Basic]
Public Interface IBatchEntry
[C#]
public interface IBatchEntry

Remarks

To create a worker that can be executed within the batch queue, implement this interface. The interface will be invoked by the batch queue processor on the server.

Requirements

Namespace: CSLA.BatchQueue Namespace

Assembly: CSLA.BatchQueue.dll

See Also

IBatchEntry Members | CSLA.BatchQueue Namespace


IBatchEntry Members

Public Instance Methods

Execute This method should contain your worker code that is to be run in the batch queue.

See Also

IBatchEntry Interface | CSLA.BatchQueue Namespace


IBatchEntry Methods

The methods of the IBatchEntry interface are listed below. For a complete list of IBatchEntry interface members, see the IBatchEntry Members topic.

Public Instance Methods

Execute This method should contain your worker code that is to be run in the batch queue.

See Also

IBatchEntry Interface | CSLA.BatchQueue Namespace


IBatchEntry.Execute Method

This method should contain your worker code that is to be run in the batch queue.

[Visual Basic]
Sub Execute( _
   ByVal State As Object _
)
[C#]
void Execute(
object State
);

Parameters

State
An optional object containing extra state data from the client.

See Also

IBatchEntry Interface | IBatchEntry Members | CSLA.BatchQueue Namespace


CSLA.BatchQueue.Server

CSLA .NET

CSLA.BatchQueue.Server Namespace

Namespace hierarchy

Classes

Class | Description
BatchEntry | A batch queue entry.
BatchQueue | This is the entry point for all queue requests from the client via Remoting.
BatchQueueService | Implements the batch queue service.


BatchEntry Class

A batch queue entry.

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

System.Object
BatchEntry

[Visual Basic]
NotInheritable Public Class BatchEntry
[C#]
public sealed class BatchEntry

Remarks

Each batch queue entry consists of basic information about the entry, a Principal object (if you are using CSLA .NET security), the actual worker object containing the code to be run and an optional state object containing arbitrary state data.

Requirements

Namespace: CSLA.BatchQueue.Server Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry Members

Public Instance Properties

Entry | Returns a reference to the worker object that contains the code which is to be executed as a batch process.
Info | Returns a reference to the object containing information about this batch entry.
Principal | Returns a reference to the BusinessPrincipal object for the user that submitted this entry.
State | Returns a reference to the optional state object.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode |
GetType (inherited from Object) | Gets the Type of the current instance.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchEntry Class | CSLA.BatchQueue.Server Namespace


BatchEntry Properties

The properties of the BatchEntry class are listed below. For a complete list of BatchEntry class members, see the BatchEntry Members topic.

Public Instance Properties

Entry | Returns a reference to the worker object that contains the code which is to be executed as a batch process.
Info | Returns a reference to the object containing information about this batch entry.
Principal | Returns a reference to the BusinessPrincipal object for the user that submitted this entry.
State | Returns a reference to the optional state object.

See Also

BatchEntry Class | CSLA.BatchQueue.Server Namespace


BatchEntry.Entry Property

Returns a reference to the worker object that contains the code which is to be executed as a batch process.

[Visual Basic]
Public Property Entry As IBatchEntry
[C#]
public CSLA.BatchQueue.IBatchEntry Entry {get; set;}

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry.Info Property

Returns a reference to the object containing information about this batch entry.

[Visual Basic]
Public ReadOnly Property Info As BatchEntryInfo
[C#]
public CSLA.BatchQueue.BatchEntryInfo Info {get;}

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry.Principal Property

Returns a reference to the BusinessPrincipal object for the user that submitted this entry.

[Visual Basic]
Public ReadOnly Property Principal As IPrincipal
[C#]
public System.Security.Principal.IPrincipal Principal {get;}

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry.State Property

Returns a reference to the optional state object.

[Visual Basic]
Public Property State As Object
[C#]
public object State {get; set;}

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry Methods

The methods of the BatchEntry class are listed below. For a complete list of BatchEntry class members, see the BatchEntry Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode |
GetType (inherited from Object) | Gets the Type of the current instance.
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchEntry Class | CSLA.BatchQueue.Server Namespace


Equals Method

CSLA .NET

BatchEntry.Equals Method

Overload List

Inherited from Object.

public virtual bool Equals(object);

public bool Equals(BatchEntry);

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry.Equals Method (BatchEntry)

[Visual Basic]
Overloads Public Function Equals( _
   ByVal Entry As BatchEntry _
) As Boolean
[C#]
public bool Equals(
BatchEntry Entry
);

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace | BatchEntry.Equals Overload List


BatchEntry.GetHashCode Method

[Visual Basic]
Overrides Public Function GetHashCode() As Integer
[C#]
public override int GetHashCode();

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchEntry.ToString Method

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

See Also

BatchEntry Class | BatchEntry Members | CSLA.BatchQueue.Server Namespace


BatchQueue Class

This is the entry point for all queue requests from the client via Remoting.

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

System.Object
MarshalByRefObject
BatchQueue

[Visual Basic]
Public Class BatchQueue
Inherits MarshalByRefObject
[C#]
public class BatchQueue : MarshalByRefObject

Requirements

Namespace: CSLA.BatchQueue.Server Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchQueue Members | CSLA.BatchQueue.Server Namespace


BatchQueue Members

Public Instance Constructors

BatchQueue Constructor Initializes a new instance of the BatchQueue class.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEntries | Gets a list of the entries currently in the batch queue.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Remove | Removes a holding or pending entry from the queue.
Submit | Submits a batch entry to the queue.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchQueue Class | CSLA.BatchQueue.Server Namespace


BatchQueue Constructor

Initializes a new instance of the BatchQueue class.

[Visual Basic]
Public Sub New()
[C#]
public BatchQueue();

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue.Server Namespace


BatchQueue Methods

The methods of the BatchQueue class are listed below. For a complete list of BatchQueue class members, see the BatchQueue Members topic.

Public Instance Methods

CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEntries | Gets a list of the entries currently in the batch queue.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
Remove | Removes a holding or pending entry from the queue.
Submit | Submits a batch entry to the queue.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchQueue Class | CSLA.BatchQueue.Server Namespace


BatchQueue.GetEntries Method

Gets a list of the entries currently in the batch queue.

[Visual Basic]
Public Function GetEntries( _
   ByVal Principal As IPrincipal _
) As BatchEntries
[C#]
public BatchEntries GetEntries(
IPrincipal Principal
);

Parameters

Principal
The requesting user's security credentials.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue.Server Namespace


BatchQueue.Remove Method

Removes a holding or pending entry from the queue.

[Visual Basic]
Public Sub Remove( _
   ByVal Entry As BatchEntryInfo _
)
[C#]
public void Remove(
BatchEntryInfo Entry
);

Parameters

Entry
A reference to the info object for the batch entry.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue.Server Namespace


BatchQueue.Submit Method

Submits a batch entry to the queue.

[Visual Basic]
Public Sub Submit( _
   ByVal Entry As BatchEntry _
)
[C#]
public void Submit(
BatchEntry Entry
);

Parameters

Entry
A reference to the batch entry.

See Also

BatchQueue Class | BatchQueue Members | CSLA.BatchQueue.Server Namespace


BatchQueueService Class

Implements the batch queue service.

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

System.Object
BatchQueueService

[Visual Basic]
Public Class BatchQueueService
[C#]
public class BatchQueueService

Remarks

This class implements the server-side batch queue functionality. It must be hosted within some process, typically a Windows Service. It may also be hosted within a console application, which is useful for testing and debugging.

Requirements

Namespace: CSLA.BatchQueue.Server Namespace

Assembly: CSLA.BatchQueue.dll

See Also

BatchQueueService Members | CSLA.BatchQueue.Server Namespace


BatchQueueService Members

Public Static (Shared) Properties

Name Returns the name of the batch queue server.

Public Static (Shared) Methods

Start | Starts the batch queue.
Stop | Stops the batch queue.

Public Instance Constructors

BatchQueueService Constructor Initializes a new instance of the BatchQueueService class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchQueueService Class | CSLA.BatchQueue.Server Namespace


BatchQueueService Constructor

Initializes a new instance of the BatchQueueService class.

[Visual Basic]
Public Sub New()
[C#]
public BatchQueueService();

See Also

BatchQueueService Class | BatchQueueService Members | CSLA.BatchQueue.Server Namespace


BatchQueueService Properties

The properties of the BatchQueueService class are listed below. For a complete list of BatchQueueService class members, see the BatchQueueService Members topic.

Public Static (Shared) Properties

Name Returns the name of the batch queue server.

See Also

BatchQueueService Class | CSLA.BatchQueue.Server Namespace


BatchQueueService.Name Property

Returns the name of the batch queue server.

[Visual Basic]
Public Shared ReadOnly Property Name As String
[C#]
public static string Name {get;}

See Also

BatchQueueService Class | BatchQueueService Members | CSLA.BatchQueue.Server Namespace


BatchQueueService Methods

The methods of the BatchQueueService class are listed below. For a complete list of BatchQueueService class members, see the BatchQueueService Members topic.

Public Static (Shared) Methods

Start | Starts the batch queue.
Stop | Stops the batch queue.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BatchQueueService Class | CSLA.BatchQueue.Server Namespace


BatchQueueService.Start Method

Starts the batch queue.

[Visual Basic]
Public Shared Sub Start()
[C#]
public static void Start();

Remarks

Call this as your Windows Service starts up to start the batch queue itself. This will cause the queue to start listening for user requests via remoting and to the MSMQ for queued jobs.

See Also

BatchQueueService Class | BatchQueueService Members | CSLA.BatchQueue.Server Namespace


BatchQueueService.Stop Method

Stops the batch queue.

[Visual Basic]
Public Shared Sub Stop()
[C#]
public static void Stop();

Remarks

Call this as your Windows Service is stopping. It stops the batch queue, causing it to stop listening for user requests via remoting and to stop looking for jobs in the MSMQ queue.

NOTE that this method will not return until any currently active (executing) batch jobs have completed.

See Also

BatchQueueService Class | BatchQueueService Members | CSLA.BatchQueue.Server Namespace


CSLA.Core

CSLA .NET

CSLA.Core Namespace

Namespace hierarchy

Classes

Class | Description
BindableBase | This base class declares the IsDirtyChanged event to be NonSerialized so serialization will work.
BindableCollectionBase | This is a base class that exposes an implementation of IBindableList that does nothing other than create a nonserialized version of the listchanged event.
SortableCollectionBase | This class implements sorting functionality for collections.
UndoableBase | Implements n-level undo capabilities.


BindableBase Class

This base class declares the IsDirtyChanged event to be NonSerialized so serialization will work.

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

System.Object
BindableBase

[Visual Basic]
MustInherit Public Class BindableBase
[C#]
public abstract class BindableBase

Requirements

Namespace: CSLA.Core Namespace

Assembly: CSLA.Core.Bindablebase.dll

See Also

BindableBase Members | CSLA.Core Namespace


BindableBase Members

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

IsDirtyChanged Declares a serialization-safe IsDirtyChanged event.

Protected Instance Constructors

BindableBase Constructor Initializes a new instance of the BindableBase class.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnIsDirtyChanged | Call this method to raise the IsDirtyChanged event.

See Also

BindableBase Class | CSLA.Core Namespace


BindableBase Constructor

Initializes a new instance of the BindableBase class.

[Visual Basic]
Protected Sub New()
[C#]
protected BindableBase();

See Also

BindableBase Class | BindableBase Members | CSLA.Core Namespace


BindableBase Methods

The methods of the BindableBase class are listed below. For a complete list of BindableBase class members, see the BindableBase Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnIsDirtyChanged | Call this method to raise the IsDirtyChanged event.

See Also

BindableBase Class | CSLA.Core Namespace


BindableBase.OnIsDirtyChanged Method

Call this method to raise the IsDirtyChanged event.

[Visual Basic]
Overridable Protected Sub OnIsDirtyChanged()
[C#]
protected virtual void OnIsDirtyChanged();

See Also

BindableBase Class | BindableBase Members | CSLA.Core Namespace


BindableBase Events

The events of the BindableBase class are listed below. For a complete list of BindableBase class members, see the BindableBase Members topic.

Public Instance Events

IsDirtyChanged Declares a serialization-safe IsDirtyChanged event.

See Also

BindableBase Class | CSLA.Core Namespace


BindableBase.IsDirtyChanged Event

Declares a serialization-safe IsDirtyChanged event.

[Visual Basic]
Public Event IsDirtyChanged As EventHandler
[C#]
public event EventHandler IsDirtyChanged;

See Also

BindableBase Class | BindableBase Members | CSLA.Core Namespace


BindableCollectionBase Class

This is a base class that exposes an implementation of IBindableList that does nothing other than create a nonserialized version of the listchanged event.

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

System.Object
CollectionBase
BindableCollectionBase

[Visual Basic]
MustInherit Public Class BindableCollectionBase
Inherits CollectionBase
Implements IBindingList
[C#]
public abstract class BindableCollectionBase : CollectionBase, IBindingList

Requirements

Namespace: CSLA.Core Namespace

Assembly: CSLA.Core.Bindablebase.dll

See Also

BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase Members

Public Instance Properties

Count (inherited from CollectionBase) Gets the number of elements contained in the CollectionBase instance.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ListChanged Declares a serialization-safe ListChanged event.

Protected Instance Constructors

BindableCollectionBase Constructor Initializes a new instance of the BindableCollectionBase class.

Protected Instance Fields

AllowEdit | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind | Set this to True to allow this collection to be searched.
AllowNew | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort | Set this to True to allow this collection to be sorted.

Protected Instance Properties

IBindingList_IsSorted | Override this method to indicate whether your collection is currently sorted. This returns False by default.
IBindingList_SortDirection | Override this method to return the current sort direction (if you implement sorting).
IBindingList_SortProperty | Override this method to return the property by which the collection is sorted (if you implement sorting).
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort | Override this method to provide sorting functionality (if you implement sorting).
IBindingList_Find | Override this method to implement search/find functionality for the collection.
IBindingList_RemoveSort | Override this method to remove any existing sort (if you implement sorting).
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete | Ensures that the OnListChanged event is raised when the list is cleared.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete | Ensures that the OnListChanged event is raised when a new child is inserted.
OnListChanged | Call this method to raise the ListChanged event.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete | Ensures that the OnListChanged event is raised when an item is removed.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

IBindingList.AddIndex
IBindingList.AddNew
IBindingList.ApplySort
IBindingList.Find
IBindingList.RemoveIndex
IBindingList.RemoveSort
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BindableCollectionBase Class | CSLA.Core Namespace


BindableCollectionBase Constructor

Initializes a new instance of the BindableCollectionBase class.

[Visual Basic]
Protected Sub New()
[C#]
protected BindableCollectionBase();

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase Fields

The fields of the BindableCollectionBase class are listed below. For a complete list of BindableCollectionBase class members, see the BindableCollectionBase Members topic.

Protected Instance Fields

AllowEdit | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind | Set this to True to allow this collection to be searched.
AllowNew | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort | Set this to True to allow this collection to be sorted.

See Also

BindableCollectionBase Class | CSLA.Core Namespace


BindableCollectionBase.AllowEdit Field

Set this to True to allow data binding to do in-place editing of child objects in a grid control.

[Visual Basic]
Protected AllowEdit As Boolean
[C#]
protected bool AllowEdit;

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.AllowFind Field

Set this to True to allow this collection to be searched.

[Visual Basic]
Protected AllowFind As Boolean
[C#]
protected bool AllowFind;

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.AllowNew Field

Set this to True to allow data binding to add new child objects to the collection.

[Visual Basic]
Protected AllowNew As Boolean
[C#]
protected bool AllowNew;

Remarks

If you set this to True, you must also override the OnAddNew method. You must also set AllowEdit to True.

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.AllowRemove Field

Set this to True to allow data binding to automatically remove child objects from the collection.

[Visual Basic]
Protected AllowRemove As Boolean
[C#]
protected bool AllowRemove;

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.AllowSort Field

Set this to True to allow this collection to be sorted.

[Visual Basic]
Protected AllowSort As Boolean
[C#]
protected bool AllowSort;

Remarks

There is an overhead cost to enabling sorting. Specifically, the collection must contain an internal collection containing the original order of the items in the collection, so the order can be reset if the sort is removed.

This overhead is only incurred if AllowSort is set to True, and is only a major concern if you are using a remote DataPortal. The concern there is that this extra collection must also be serialized, thus increasing the overall amount of data sent across the wire.

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase Properties

The properties of the BindableCollectionBase class are listed below. For a complete list of BindableCollectionBase class members, see the BindableCollectionBase Members topic.

Public Instance Properties

Count (inherited from CollectionBase) Gets the number of elements contained in the CollectionBase instance.

Protected Instance Properties

IBindingList_IsSorted | Override this method to indicate whether your collection is currently sorted. This returns False by default.
IBindingList_SortDirection | Override this method to return the current sort direction (if you implement sorting).
IBindingList_SortProperty | Override this method to return the property by which the collection is sorted (if you implement sorting).
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

See Also

BindableCollectionBase Class | CSLA.Core Namespace


BindableCollectionBase.IBindingList_IsSorted Property

Override this method to indicate whether your collection is currently sorted. This returns False by default.

[Visual Basic]
Overridable Protected ReadOnly Property IBindingList_IsSorted As Boolean
[C#]
protected virtual bool IBindingList_IsSorted {get;}

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList_SortDirection Property

Override this method to return the current sort direction (if you implement sorting).

[Visual Basic]
Overridable Protected ReadOnly Property IBindingList_SortDirection As ListSortDirection
[C#]
protected virtual System.ComponentModel.ListSortDirection IBindingList_SortDirection {get;}

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList_SortProperty Property

Override this method to return the property by which the collection is sorted (if you implement sorting).

[Visual Basic]
Overridable Protected ReadOnly Property IBindingList_SortProperty As PropertyDescriptor
[C#]
protected virtual System.ComponentModel.PropertyDescriptor IBindingList_SortProperty {get;}

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase Methods

The methods of the BindableCollectionBase class are listed below. For a complete list of BindableCollectionBase class members, see the BindableCollectionBase Members topic.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort | Override this method to provide sorting functionality (if you implement sorting).
IBindingList_Find | Override this method to implement search/find functionality for the collection.
IBindingList_RemoveSort | Override this method to remove any existing sort (if you implement sorting).
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete | Ensures that the OnListChanged event is raised when the list is cleared.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete | Ensures that the OnListChanged event is raised when a new child is inserted.
OnListChanged | Call this method to raise the ListChanged event.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete | Ensures that the OnListChanged event is raised when an item is removed.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

IBindingList.AddIndex
IBindingList.AddNew
IBindingList.ApplySort
IBindingList.Find
IBindingList.RemoveIndex
IBindingList.RemoveSort
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

BindableCollectionBase Class | CSLA.Core Namespace


BindableCollectionBase.IBindingList_ApplySort Method

Override this method to provide sorting functionality (if you implement sorting).

[Visual Basic]
Overridable Protected Sub IBindingList_ApplySort( _
   ByVal property As PropertyDescriptor, _
   ByVal direction As ListSortDirection _
)
[C#]
protected virtual void IBindingList_ApplySort(
PropertyDescriptor property,
ListSortDirection direction
);

Parameters

property
The property on which to sort.
direction
The sort direction.

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList_Find Method

Override this method to implement search/find functionality for the collection.

[Visual Basic]
Overridable Protected Function IBindingList_Find( _
   ByVal property As PropertyDescriptor, _
   ByVal key As Object _
) As Integer
[C#]
protected virtual int IBindingList_Find(
PropertyDescriptor property,
object key
);

Parameters

property
The property to search.
key
The value to searched for.

Return Value

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList_RemoveSort Method

Override this method to remove any existing sort (if you implement sorting).

[Visual Basic]
Overridable Protected Sub IBindingList_RemoveSort()
[C#]
protected virtual void IBindingList_RemoveSort();

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.OnAddNew Method

Override this method to allow data binding to automatically add new child objects to a collection.

[Visual Basic]
Overridable Protected Function OnAddNew() As Object
[C#]
protected virtual object OnAddNew();

Return Value

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.OnClearComplete Method

Ensures that the OnListChanged event is raised when the list is cleared.

[Visual Basic]
Overrides Protected Sub OnClearComplete()
[C#]
protected override void OnClearComplete();

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.OnInsertComplete Method

Ensures that the OnListChanged event is raised when a new child is inserted.

[Visual Basic]
Overrides Protected Sub OnInsertComplete( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnInsertComplete(
int index,
object value
);

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.OnListChanged Method

Call this method to raise the ListChanged event.

[Visual Basic]
Overridable Protected Sub OnListChanged( _
   ByVal e As ListChangedEventArgs _
)
[C#]
protected virtual void OnListChanged(
ListChangedEventArgs e
);

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.OnRemoveComplete Method

Ensures that the OnListChanged event is raised when an item is removed.

[Visual Basic]
Overrides Protected Sub OnRemoveComplete( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnRemoveComplete(
int index,
object value
);

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.OnSetComplete Method

Ensures that the OnListChanged event is raised when an item is changed.

[Visual Basic]
Overrides Protected Sub OnSetComplete( _
   ByVal index As Integer, _
   ByVal oldValue As Object, _
   ByVal newValue As Object _
)
[C#]
protected override void OnSetComplete(
int index,
object oldValue,
object newValue
);

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList.AddIndex Method

[Visual Basic]
Sub AddIndex( _
   ByVal property As PropertyDescriptor _
) Implements _
   IBindingList.AddIndex
[C#]
void IBindingList.AddIndex(
PropertyDescriptor property
);

Implements

IBindingList.AddIndex

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList.AddNew Method

[Visual Basic]
Function AddNew() As Object Implements _
   IBindingList.AddNew
[C#]
object IBindingList.AddNew();

Implements

IBindingList.AddNew

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList.ApplySort Method

[Visual Basic]
Sub ApplySort( _
   ByVal property As PropertyDescriptor, _
   ByVal direction As ListSortDirection _
) Implements _
   IBindingList.ApplySort
[C#]
void IBindingList.ApplySort(
PropertyDescriptor property,
ListSortDirection direction
);

Implements

IBindingList.ApplySort

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList.Find Method

[Visual Basic]
Function Find( _
   ByVal property As PropertyDescriptor, _
   ByVal key As Object _
) As Integer Implements _
   IBindingList.Find
[C#]
int IBindingList.Find(
PropertyDescriptor property,
object key
);

Implements

IBindingList.Find

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList.RemoveIndex Method

[Visual Basic]
Sub RemoveIndex( _
   ByVal property As PropertyDescriptor _
) Implements _
   IBindingList.RemoveIndex
[C#]
void IBindingList.RemoveIndex(
PropertyDescriptor property
);

Implements

IBindingList.RemoveIndex

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase.IBindingList.RemoveSort Method

[Visual Basic]
Sub RemoveSort() Implements _
   IBindingList.RemoveSort
[C#]
void IBindingList.RemoveSort();

Implements

IBindingList.RemoveSort

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


BindableCollectionBase Events

The events of the BindableCollectionBase class are listed below. For a complete list of BindableCollectionBase class members, see the BindableCollectionBase Members topic.

Public Instance Events

ListChanged Declares a serialization-safe ListChanged event.

See Also

BindableCollectionBase Class | CSLA.Core Namespace


BindableCollectionBase.ListChanged Event

Declares a serialization-safe ListChanged event.

[Visual Basic]
Public Event ListChanged As ListChangedEventHandler
[C#]
public event ListChangedEventHandler ListChanged;

Implements

IBindingList.ListChanged

See Also

BindableCollectionBase Class | BindableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase Class

This class implements sorting functionality for collections.

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

System.Object
CollectionBase
BindableCollectionBase
SortableCollectionBase

[Visual Basic]
Public Class SortableCollectionBase
Inherits BindableCollectionBase
[C#]
public class SortableCollectionBase : BindableCollectionBase

Remarks

This class inhirits from Core.BindableCollectionBase and adds sorting capability to collections. BusinessCollectionBase inherits from this class, and business collections should inherit from BusinessCollectionBase. Core.SortedCollectionBase is for internal framework use only.

The Core.BindableCollectionBase class implements the IBindableList interface. However, it doesn't actually implement sorting. Instead it delegates the sorting functionality to a set of protected virtual methods. This class provides the actual sorting implementation by overriding those methods.

Requirements

Namespace: CSLA.Core Namespace

Assembly: CSLA.dll

See Also

SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase Members

Public Instance Constructors

SortableCollectionBase Constructor Initializes a new instance of the SortableCollectionBase class.

Public Instance Properties

Count (inherited from CollectionBase) Gets the number of elements contained in the CollectionBase instance.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

ListChanged (inherited from BindableCollectionBase) Declares a serialization-safe ListChanged event.

Protected Instance Fields

AllowEdit (inherited from BindableCollectionBase) | Set this to True to allow data binding to do in-place editing of child objects in a grid control.
AllowFind (inherited from BindableCollectionBase) | Set this to True to allow this collection to be searched.
AllowNew (inherited from BindableCollectionBase) | Set this to True to allow data binding to add new child objects to the collection.
AllowRemove (inherited from BindableCollectionBase) | Set this to True to allow data binding to automatically remove child objects from the collection.
AllowSort (inherited from BindableCollectionBase) | Set this to True to allow this collection to be sorted.

Protected Instance Properties

ActivelySorting | Indicates whether the collection is in the process of being sorted at this time.
IBindingList_IsSorted | Returns a value indicating whether the collection is currently sorted.
IBindingList_SortDirection | Returns the current sort direction.
IBindingList_SortProperty | Returns the property by which the collection is currently sorted.
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort | Applies a sort to the collection.
IBindingList_Find | Implements search/find functionality for the collection.
IBindingList_RemoveSort | Removes any sort from the collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete | Ensures that any sort is maintained as the list is cleared.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete | Ensures that any sort is maintained as a new item is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete | Ensures that any sort is maintained as an item is removed.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

SortableCollectionBase Class | CSLA.Core Namespace


SortableCollectionBase Constructor

Initializes a new instance of the SortableCollectionBase class.

[Visual Basic]
Public Sub New()
[C#]
public SortableCollectionBase();

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase Properties

The properties of the SortableCollectionBase class are listed below. For a complete list of SortableCollectionBase class members, see the SortableCollectionBase Members topic.

Public Instance Properties

Count (inherited from CollectionBase) Gets the number of elements contained in the CollectionBase instance.

Protected Instance Properties

ActivelySorting | Indicates whether the collection is in the process of being sorted at this time.
IBindingList_IsSorted | Returns a value indicating whether the collection is currently sorted.
IBindingList_SortDirection | Returns the current sort direction.
IBindingList_SortProperty | Returns the property by which the collection is currently sorted.
InnerList (inherited from CollectionBase) | Gets an ArrayList containing the list of elements in the CollectionBase instance.
List (inherited from CollectionBase) | Gets an IList containing the list of elements in the CollectionBase instance.

See Also

SortableCollectionBase Class | CSLA.Core Namespace


SortableCollectionBase.ActivelySorting Property

Indicates whether the collection is in the process of being sorted at this time.

[Visual Basic]
Protected ReadOnly Property ActivelySorting As Boolean
[C#]
protected bool ActivelySorting {get;}

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.IBindingList_IsSorted Property

Returns a value indicating whether the collection is currently sorted.

[Visual Basic]
Overrides Overloads Protected ReadOnly Property IBindingList_IsSorted As Boolean
[C#]
protected override bool IBindingList_IsSorted {get;}

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.IBindingList_SortDirection Property

Returns the current sort direction.

[Visual Basic]
Overrides Overloads Protected ReadOnly Property IBindingList_SortDirection As ListSortDirection
[C#]
protected override System.ComponentModel.ListSortDirection IBindingList_SortDirection {get;}

Remarks

This method is invoked via the IBindingList interface and is not intended for use by code in your business class.

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.IBindingList_SortProperty Property

Returns the property by which the collection is currently sorted.

[Visual Basic]
Overrides Overloads Protected ReadOnly Property IBindingList_SortProperty As PropertyDescriptor
[C#]
protected override System.ComponentModel.PropertyDescriptor IBindingList_SortProperty {get;}

Remarks

This method is invoked via the IBindingList interface and is not intended for use by code in your business class.

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase Methods

The methods of the SortableCollectionBase class are listed below. For a complete list of SortableCollectionBase class members, see the SortableCollectionBase Members topic.

Public Instance Methods

Clear (inherited from CollectionBase) | Removes all objects from the CollectionBase instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator (inherited from CollectionBase) | Returns an enumerator that can iterate through the CollectionBase instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
RemoveAt (inherited from CollectionBase) | Removes the element at the specified index of the CollectionBase instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
IBindingList_ApplySort | Applies a sort to the collection.
IBindingList_Find | Implements search/find functionality for the collection.
IBindingList_RemoveSort | Removes any sort from the collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAddNew (inherited from BindableCollectionBase) | Override this method to allow data binding to automatically add new child objects to a collection.
OnClear (inherited from CollectionBase) | Performs additional custom processes when clearing the contents of the CollectionBase instance.
OnClearComplete | Ensures that any sort is maintained as the list is cleared.
OnInsert (inherited from CollectionBase) | Performs additional custom processes before inserting a new element into the CollectionBase instance.
OnInsertComplete | Ensures that any sort is maintained as a new item is inserted.
OnListChanged (inherited from BindableCollectionBase) | Call this method to raise the ListChanged event.
OnRemove (inherited from CollectionBase) | Performs additional custom processes when removing an element from the CollectionBase instance.
OnRemoveComplete | Ensures that any sort is maintained as an item is removed.
OnSet (inherited from CollectionBase) | Performs additional custom processes before setting a value in the CollectionBase instance.
OnSetComplete (inherited from BindableCollectionBase) | Ensures that the OnListChanged event is raised when an item is changed.
OnValidate (inherited from CollectionBase) | Performs additional custom processes when validating a value.

Explicit Interface Implementations

IBindingList.AddIndex (inherited from BindableCollectionBase)
IBindingList.AddNew (inherited from BindableCollectionBase)
IBindingList.ApplySort (inherited from BindableCollectionBase)
IBindingList.Find (inherited from BindableCollectionBase)
IBindingList.RemoveIndex (inherited from BindableCollectionBase)
IBindingList.RemoveSort (inherited from BindableCollectionBase)
ICollection.CopyTo (inherited from CollectionBase)
IList.Add (inherited from CollectionBase)
IList.Contains (inherited from CollectionBase)
IList.IndexOf (inherited from CollectionBase)
IList.Insert (inherited from CollectionBase)
IList.Remove (inherited from CollectionBase)

See Also

SortableCollectionBase Class | CSLA.Core Namespace


SortableCollectionBase.IBindingList_ApplySort Method

Applies a sort to the collection.

[Visual Basic]
Overrides Protected Sub IBindingList_ApplySort( _
   ByVal property As PropertyDescriptor, _
   ByVal direction As ListSortDirection _
)
[C#]
protected override void IBindingList_ApplySort(
PropertyDescriptor property,
ListSortDirection direction
);

Remarks

This method is invoked via the IBindingList interface and is not intended for use by code in your business class.

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.IBindingList_Find Method

Implements search/find functionality for the collection.

[Visual Basic]
Overrides Protected Function IBindingList_Find( _
   ByVal property As PropertyDescriptor, _
   ByVal key As Object _
) As Integer
[C#]
protected override int IBindingList_Find(
PropertyDescriptor property,
object key
);

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.IBindingList_RemoveSort Method

Removes any sort from the collection.

[Visual Basic]
Overrides Protected Sub IBindingList_RemoveSort()
[C#]
protected override void IBindingList_RemoveSort();

Remarks

This method is invoked via the IBindingList interface and is not intended for use by code in your business class.

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.OnClearComplete Method

Ensures that any sort is maintained as the list is cleared.

[Visual Basic]
Overrides Protected Sub OnClearComplete()
[C#]
protected override void OnClearComplete();

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.OnInsertComplete Method

Ensures that any sort is maintained as a new item is inserted.

[Visual Basic]
Overrides Protected Sub OnInsertComplete( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnInsertComplete(
int index,
object value
);

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


SortableCollectionBase.OnRemoveComplete Method

Ensures that any sort is maintained as an item is removed.

[Visual Basic]
Overrides Protected Sub OnRemoveComplete( _
   ByVal index As Integer, _
   ByVal value As Object _
)
[C#]
protected override void OnRemoveComplete(
int index,
object value
);

See Also

SortableCollectionBase Class | SortableCollectionBase Members | CSLA.Core Namespace


UndoableBase Class

Implements n-level undo capabilities.

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

System.Object
BindableBase
UndoableBase

[Visual Basic]
MustInherit Public Class UndoableBase
Inherits BindableBase
[C#]
public abstract class UndoableBase : BindableBase

Remarks

You should not directly derive from this class. Your business classes should derive from CSLA.BusinessBase.

Requirements

Namespace: CSLA.Core Namespace

Assembly: CSLA.dll

See Also

UndoableBase Members | CSLA.Core Namespace


UndoableBase Members

Public Instance Constructors

UndoableBase Constructor Initializes a new instance of the UndoableBase class.

Public Instance Methods

DumpState | Writes the object's field data into the debugger output window in VS.NET.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

IsDirtyChanged (inherited from BindableBase) Declares a serialization-safe IsDirtyChanged event.

Protected Instance Properties

EditLevel Returns the current edit level of the object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnIsDirtyChanged (inherited from BindableBase) | Call this method to raise the IsDirtyChanged event.

Protected Internal Instance Methods

AcceptChanges | Accepts any changes made to the object since the last state copy was made.
CopyState | Copies the state of the object and places the copy onto the state stack.
UndoChanges | Restores the object's state to the most recently copied values from the state stack.

See Also

UndoableBase Class | CSLA.Core Namespace


UndoableBase Constructor

Initializes a new instance of the UndoableBase class.

[Visual Basic]
Public Sub New()
[C#]
public UndoableBase();

See Also

UndoableBase Class | UndoableBase Members | CSLA.Core Namespace


UndoableBase Properties

The properties of the UndoableBase class are listed below. For a complete list of UndoableBase class members, see the UndoableBase Members topic.

Protected Instance Properties

EditLevel Returns the current edit level of the object.

See Also

UndoableBase Class | CSLA.Core Namespace


UndoableBase.EditLevel Property

Returns the current edit level of the object.

[Visual Basic]
Protected ReadOnly Property EditLevel As Integer
[C#]
protected int EditLevel {get;}

See Also

UndoableBase Class | UndoableBase Members | CSLA.Core Namespace


UndoableBase Methods

The methods of the UndoableBase class are listed below. For a complete list of UndoableBase class members, see the UndoableBase Members topic.

Public Instance Methods

DumpState | Writes the object's field data into the debugger output window in VS.NET.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnIsDirtyChanged (inherited from BindableBase) | Call this method to raise the IsDirtyChanged event.

Protected Internal Instance Methods

AcceptChanges | Accepts any changes made to the object since the last state copy was made.
CopyState | Copies the state of the object and places the copy onto the state stack.
UndoChanges | Restores the object's state to the most recently copied values from the state stack.

See Also

UndoableBase Class | CSLA.Core Namespace


UndoableBase.AcceptChanges Method

Accepts any changes made to the object since the last state copy was made.

[Visual Basic]
Protected Friend Sub AcceptChanges()
[C#]
protected internal void AcceptChanges();

Remarks

The most recent state copy is removed from the state stack and discarded, thus committing any changes made to the object's state.

See Also

UndoableBase Class | UndoableBase Members | CSLA.Core Namespace


UndoableBase.CopyState Method

Copies the state of the object and places the copy onto the state stack.

[Visual Basic]
Protected Friend Sub CopyState()
[C#]
protected internal void CopyState();

See Also

UndoableBase Class | UndoableBase Members | CSLA.Core Namespace


UndoableBase.DumpState Method

Writes the object's field data into the debugger output window in VS.NET.

[Visual Basic]
Public Sub DumpState()
[C#]
public void DumpState();

See Also

UndoableBase Class | UndoableBase Members | CSLA.Core Namespace


UndoableBase.UndoChanges Method

Restores the object's state to the most recently copied values from the state stack.

[Visual Basic]
Protected Friend Sub UndoChanges()
[C#]
protected internal void UndoChanges();

Remarks

Restores the state of the object to its previous value by taking the data out of the stack and restoring it into the fields of the object.

See Also

UndoableBase Class | UndoableBase Members | CSLA.Core Namespace


CSLA.Data

CSLA .NET

CSLA.Data Namespace

Namespace hierarchy

Classes

Class | Description
ObjectAdapter | An ObjectAdapter is used to convert data in an object or collection into a DataTable.
SafeDataReader | This is a DataReader that 'fixes' any null values before they are returned to our business code.


ObjectAdapter Class

An ObjectAdapter is used to convert data in an object or collection into a DataTable.

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

System.Object
ObjectAdapter

[Visual Basic]
Public Class ObjectAdapter
[C#]
public class ObjectAdapter

Requirements

Namespace: CSLA.Data Namespace

Assembly: CSLA.dll

See Also

ObjectAdapter Members | CSLA.Data Namespace


ObjectAdapter Members

Public Instance Constructors

ObjectAdapter Constructor Initializes a new instance of the ObjectAdapter class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fill | Overloaded. Fills the DataSet with data from an object or collection.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ObjectAdapter Class | CSLA.Data Namespace


ObjectAdapter Constructor

Initializes a new instance of the ObjectAdapter class.

[Visual Basic]
Public Sub New()
[C#]
public ObjectAdapter();

See Also

ObjectAdapter Class | ObjectAdapter Members | CSLA.Data Namespace


ObjectAdapter Methods

The methods of the ObjectAdapter class are listed below. For a complete list of ObjectAdapter class members, see the ObjectAdapter Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fill | Overloaded. Fills the DataSet with data from an object or collection.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ObjectAdapter Class | CSLA.Data Namespace


Fill Method

CSLA .NET

ObjectAdapter.Fill Method

Fills the DataSet with data from an object or collection.

Overload List

Fills the DataSet with data from an object or collection.

public void Fill(DataSet,object);

Fills the DataSet with data from an object or collection.

public void Fill(DataSet,string,object);

Fills a DataTable with data values from an object or collection.

public void Fill(DataTable,object);

See Also

ObjectAdapter Class | ObjectAdapter Members | CSLA.Data Namespace


ObjectAdapter.Fill Method (DataSet, Object)

Fills the DataSet with data from an object or collection.

[Visual Basic]
Overloads Public Sub Fill( _
   ByVal ds As DataSet, _
   ByVal source As Object _
)
[C#]
public void Fill(
DataSet ds,
object source
);

Parameters

ds
A reference to the DataSet to be filled.
source
A reference to the object or collection acting as a data source.

Remarks

The name of the DataTable being filled is will be the class name of the object acting as the data source. The DataTable will be inserted if it doesn't already exist in the DataSet.

See Also

ObjectAdapter Class | ObjectAdapter Members | CSLA.Data Namespace | ObjectAdapter.Fill Overload List


ObjectAdapter.Fill Method (DataSet, String, Object)

Fills the DataSet with data from an object or collection.

[Visual Basic]
Overloads Public Sub Fill( _
   ByVal ds As DataSet, _
   ByVal TableName As String, _
   ByVal source As Object _
)
[C#]
public void Fill(
DataSet ds,
string TableName,
object source
);

Parameters

ds
A reference to the DataSet to be filled.
TableName
source
A reference to the object or collection acting as a data source.

Remarks

The name of the DataTable being filled is specified as a parameter. The DataTable will be inserted if it doesn't already exist in the DataSet.

See Also

ObjectAdapter Class | ObjectAdapter Members | CSLA.Data Namespace | ObjectAdapter.Fill Overload List


ObjectAdapter.Fill Method (DataTable, Object)

Fills a DataTable with data values from an object or collection.

[Visual Basic]
Overloads Public Sub Fill( _
   ByVal dt As DataTable, _
   ByVal source As Object _
)
[C#]
public void Fill(
DataTable dt,
object source
);

Parameters

dt
A reference to the DataTable to be filled.
source
A reference to the object or collection acting as a data source.

See Also

ObjectAdapter Class | ObjectAdapter Members | CSLA.Data Namespace | ObjectAdapter.Fill Overload List


SafeDataReader Class

This is a DataReader that 'fixes' any null values before they are returned to our business code.

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

System.Object
SafeDataReader

[Visual Basic]
Public Class SafeDataReader
Implements IDataReader, IDisposable, IDataRecord
[C#]
public class SafeDataReader : IDataReader, IDisposable, IDataRecord

Requirements

Namespace: CSLA.Data Namespace

Assembly: CSLA.dll

See Also

SafeDataReader Members | CSLA.Data Namespace


SafeDataReader Members

Public Instance Constructors

SafeDataReader Constructor Initializes the SafeDataReader object to use data from the provided DataReader object.

Public Instance Properties

Depth | Returns the depth property value from the datareader.
FieldCount | Returns the FieldCount property from the datareader.
IsClosed | Returns the IsClosed property value from the datareader.
Item | Overloaded. Returns a value from the datareader.
RecordsAffected | Returns the RecordsAffected property value from the underlying datareader.

Public Instance Methods

Close | Closes the datareader.
Dispose | Calls the Dispose method on the underlying datareader.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBoolean | Overloaded. Gets a boolean value from the datareader.
GetByte | Overloaded. Gets a byte value from the datareader.
GetBytes | Overloaded. Invokes the GetBytes method of the underlying datareader.
GetChar | Overloaded. Gets a char value from the datareader.
GetChars | Overloaded. Invokes the GetChars method of the underlying datareader.
GetData | Overloaded. Invokes the GetData method of the underlying datareader.
GetDataTypeName | Overloaded. Invokes the GetDataTypeName method of the underlying datareader.
GetDateTime | Overloaded. Gets a date value from the datareader.
GetDecimal | Overloaded. Gets a decimal value from the datareader.
GetDouble | Overloaded. Gets a double from the datareader.
GetFieldType | Overloaded. Invokes the GetFieldType method of the underlying datareader.
GetFloat | Overloaded. Gets a Single value from the datareader.
GetGuid | Overloaded. Gets a Guid value from the datareader.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetInt16 | Overloaded. Gets a Short value from the datareader.
GetInt32 | Overloaded. Gets an integer from the datareader.
GetInt64 | Overloaded. Gets a Long value from the datareader.
GetName | Invokes the GetName method of the underlying datareader.
GetOrdinal | Gets an ordinal value from the datareader.
GetSchemaTable | Invokes the GetSchemaTable method of the underlying datareader.
GetSmartDate | Overloaded. Gets a SmartDate from the datareader.
GetString | Overloaded. Gets a string value from the datareader.
GetType (inherited from Object) | Gets the Type of the current instance.
GetValue | Overloaded. Gets a value of type System.Object from the datareader.
GetValues | Invokes the GetValues method of the underlying datareader.
IsDBNull | Overloaded. Invokes the IsDBNull method of the underlying datareader.
NextResult | Moves to the next result set in the datareader.
Read | Reads the next row of data from the datareader.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SafeDataReader Class | CSLA.Data Namespace


SafeDataReader Constructor

Initializes the SafeDataReader object to use data from the provided DataReader object.

[Visual Basic]
Public Sub New( _
   ByVal DataReader As IDataReader _
)
[C#]
public SafeDataReader(
IDataReader DataReader
);

Parameters

DataReader
The source DataReader object containing the data.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader Properties

The properties of the SafeDataReader class are listed below. For a complete list of SafeDataReader class members, see the SafeDataReader Members topic.

Public Instance Properties

Depth | Returns the depth property value from the datareader.
FieldCount | Returns the FieldCount property from the datareader.
IsClosed | Returns the IsClosed property value from the datareader.
Item | Overloaded. Returns a value from the datareader.
RecordsAffected | Returns the RecordsAffected property value from the underlying datareader.

See Also

SafeDataReader Class | CSLA.Data Namespace


SafeDataReader.Depth Property

Returns the depth property value from the datareader.

[Visual Basic]
NotOverridable Public ReadOnly Property Depth As Integer Implements _
IDataReader.Depth
[C#]
public int Depth {get;}

Implements

IDataReader.Depth

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.FieldCount Property

Returns the FieldCount property from the datareader.

[Visual Basic]
NotOverridable Public ReadOnly Property FieldCount As Integer Implements _
IDataRecord.FieldCount
[C#]
public int FieldCount {get;}

Implements

IDataRecord.FieldCount

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.IsClosed Property

Returns the IsClosed property value from the datareader.

[Visual Basic]
NotOverridable Public ReadOnly Property IsClosed As Boolean Implements _
IDataReader.IsClosed
[C#]
public bool IsClosed {get;}

Implements

IDataReader.IsClosed

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


Item Property

CSLA .NET

SafeDataReader.Item Property

Overload List

Returns a value from the datareader.

public object this[string] {get;}

public object this[int] {get;}

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.Item Property

[Visual Basic]
NotOverridable Overloads Public Default ReadOnly Property Item( _
ByVal i As Integer _
) Implements _
IDataRecord.Item As Object Implements _
IDataRecord.Item
[C#]
public object this[
int i
] {get;}

Implements

IDataRecord.Item

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.Item Overload List


SafeDataReader.Item Property

Returns a value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Default ReadOnly Property Item( _
ByVal name As String _
) Implements _
IDataRecord.Item As Object Implements _
IDataRecord.Item
[C#]
public object this[
string name
] {get;}

Implements

IDataRecord.Item

Remarks

Returns Nothing if the value is null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.Item Overload List


SafeDataReader.RecordsAffected Property

Returns the RecordsAffected property value from the underlying datareader.

[Visual Basic]
NotOverridable Public ReadOnly Property RecordsAffected As Integer Implements _
IDataReader.RecordsAffected
[C#]
public int RecordsAffected {get;}

Implements

IDataReader.RecordsAffected

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader Methods

The methods of the SafeDataReader class are listed below. For a complete list of SafeDataReader class members, see the SafeDataReader Members topic.

Public Instance Methods

Close | Closes the datareader.
Dispose | Calls the Dispose method on the underlying datareader.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBoolean | Overloaded. Gets a boolean value from the datareader.
GetByte | Overloaded. Gets a byte value from the datareader.
GetBytes | Overloaded. Invokes the GetBytes method of the underlying datareader.
GetChar | Overloaded. Gets a char value from the datareader.
GetChars | Overloaded. Invokes the GetChars method of the underlying datareader.
GetData | Overloaded. Invokes the GetData method of the underlying datareader.
GetDataTypeName | Overloaded. Invokes the GetDataTypeName method of the underlying datareader.
GetDateTime | Overloaded. Gets a date value from the datareader.
GetDecimal | Overloaded. Gets a decimal value from the datareader.
GetDouble | Overloaded. Gets a double from the datareader.
GetFieldType | Overloaded. Invokes the GetFieldType method of the underlying datareader.
GetFloat | Overloaded. Gets a Single value from the datareader.
GetGuid | Overloaded. Gets a Guid value from the datareader.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetInt16 | Overloaded. Gets a Short value from the datareader.
GetInt32 | Overloaded. Gets an integer from the datareader.
GetInt64 | Overloaded. Gets a Long value from the datareader.
GetName | Invokes the GetName method of the underlying datareader.
GetOrdinal | Gets an ordinal value from the datareader.
GetSchemaTable | Invokes the GetSchemaTable method of the underlying datareader.
GetSmartDate | Overloaded. Gets a SmartDate from the datareader.
GetString | Overloaded. Gets a string value from the datareader.
GetType (inherited from Object) | Gets the Type of the current instance.
GetValue | Overloaded. Gets a value of type System.Object from the datareader.
GetValues | Invokes the GetValues method of the underlying datareader.
IsDBNull | Overloaded. Invokes the IsDBNull method of the underlying datareader.
NextResult | Moves to the next result set in the datareader.
Read | Reads the next row of data from the datareader.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SafeDataReader Class | CSLA.Data Namespace


SafeDataReader.Close Method

Closes the datareader.

[Visual Basic]
NotOverridable Public Sub Close() Implements _
   IDataReader.Close
[C#]
public void Close();

Implements

IDataReader.Close

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.Dispose Method

Calls the Dispose method on the underlying datareader.

[Visual Basic]
NotOverridable Public Sub Dispose() Implements _
   IDisposable.Dispose
[C#]
public void Dispose();

Implements

IDisposable.Dispose

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


GetBoolean Method

CSLA .NET

SafeDataReader.GetBoolean Method

Gets a boolean value from the datareader.

Overload List

Gets a boolean value from the datareader.

public bool GetBoolean(int);

Gets a boolean value from the datareader.

public bool GetBoolean(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetBoolean Method (Int32)

Gets a boolean value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetBoolean( _
   ByVal i As Integer _
) As Boolean Implements _
   IDataRecord.GetBoolean
[C#]
public bool GetBoolean(
int i
);

Implements

IDataRecord.GetBoolean

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetBoolean Overload List


SafeDataReader.GetBoolean Method (String)

Gets a boolean value from the datareader.

[Visual Basic]
Overloads Public Function GetBoolean( _
   ByVal Name As String _
) As Boolean
[C#]
public bool GetBoolean(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetBoolean Overload List


GetByte Method

CSLA .NET

SafeDataReader.GetByte Method

Gets a byte value from the datareader.

Overload List

Gets a byte value from the datareader.

public byte GetByte(int);

Gets a byte value from the datareader.

public byte GetByte(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetByte Method (Int32)

Gets a byte value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetByte( _
   ByVal i As Integer _
) As Byte Implements _
   IDataRecord.GetByte
[C#]
public byte GetByte(
int i
);

Implements

IDataRecord.GetByte

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetByte Overload List


SafeDataReader.GetByte Method (String)

Gets a byte value from the datareader.

[Visual Basic]
Overloads Public Function GetByte( _
   ByVal Name As String _
) As Byte
[C#]
public byte GetByte(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetByte Overload List


GetBytes Method

CSLA .NET

SafeDataReader.GetBytes Method

Invokes the GetBytes method of the underlying datareader.

Overload List

Invokes the GetBytes method of the underlying datareader.

public long GetBytes(int,long,byte[],int,int);

Invokes the GetBytes method of the underlying datareader.

public long GetBytes(string,long,byte[],int,int);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetBytes Method (Int32, Int64, Byte[], Int32, Int32)

Invokes the GetBytes method of the underlying datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetBytes( _
   ByVal i As Integer, _
   ByVal fieldOffset As Long, _
   ByVal buffer As Byte(), _
   ByVal bufferoffset As Integer, _
   ByVal length As Integer _
) As Long Implements _
   IDataRecord.GetBytes
[C#]
public long GetBytes(
int i,
long fieldOffset,
byte[] buffer,
int bufferoffset,
int length
);

Implements

IDataRecord.GetBytes

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetBytes Overload List


SafeDataReader.GetBytes Method (String, Int64, Byte[], Int32, Int32)

Invokes the GetBytes method of the underlying datareader.

[Visual Basic]
Overloads Public Function GetBytes( _
   ByVal Name As String, _
   ByVal fieldOffset As Long, _
   ByVal buffer As Byte(), _
   ByVal bufferoffset As Integer, _
   ByVal length As Integer _
) As Long
[C#]
public long GetBytes(
string Name,
long fieldOffset,
byte[] buffer,
int bufferoffset,
int length
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetBytes Overload List


GetChar Method

CSLA .NET

SafeDataReader.GetChar Method

Gets a char value from the datareader.

Overload List

Gets a char value from the datareader.

public char GetChar(int);

Gets a char value from the datareader.

public char GetChar(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetChar Method (Int32)

Gets a char value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetChar( _
   ByVal i As Integer _
) As Char Implements _
   IDataRecord.GetChar
[C#]
public char GetChar(
int i
);

Implements

IDataRecord.GetChar

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetChar Overload List


SafeDataReader.GetChar Method (String)

Gets a char value from the datareader.

[Visual Basic]
Overloads Public Function GetChar( _
   ByVal Name As String _
) As Char
[C#]
public char GetChar(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetChar Overload List


GetChars Method

CSLA .NET

SafeDataReader.GetChars Method

Invokes the GetChars method of the underlying datareader.

Overload List

Invokes the GetChars method of the underlying datareader.

public long GetChars(int,long,char[],int,int);

Invokes the GetChars method of the underlying datareader.

public long GetChars(string,long,char[],int,int);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetChars Method (Int32, Int64, Char[], Int32, Int32)

Invokes the GetChars method of the underlying datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetChars( _
   ByVal i As Integer, _
   ByVal fieldoffset As Long, _
   ByVal buffer As Char(), _
   ByVal bufferoffset As Integer, _
   ByVal length As Integer _
) As Long Implements _
   IDataRecord.GetChars
[C#]
public long GetChars(
int i,
long fieldoffset,
char[] buffer,
int bufferoffset,
int length
);

Implements

IDataRecord.GetChars

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetChars Overload List


SafeDataReader.GetChars Method (String, Int64, Char[], Int32, Int32)

Invokes the GetChars method of the underlying datareader.

[Visual Basic]
Overloads Public Function GetChars( _
   ByVal Name As String, _
   ByVal fieldoffset As Long, _
   ByVal buffer As Char(), _
   ByVal bufferoffset As Integer, _
   ByVal length As Integer _
) As Long
[C#]
public long GetChars(
string Name,
long fieldoffset,
char[] buffer,
int bufferoffset,
int length
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetChars Overload List


GetData Method

CSLA .NET

SafeDataReader.GetData Method

Invokes the GetData method of the underlying datareader.

Overload List

Invokes the GetData method of the underlying datareader.

public IDataReader GetData(int);

Invokes the GetData method of the underlying datareader.

public IDataReader GetData(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetData Method (Int32)

Invokes the GetData method of the underlying datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetData( _
   ByVal i As Integer _
) As IDataReader Implements _
   IDataRecord.GetData
[C#]
public IDataReader GetData(
int i
);

Implements

IDataRecord.GetData

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetData Overload List


SafeDataReader.GetData Method (String)

Invokes the GetData method of the underlying datareader.

[Visual Basic]
Overloads Public Function GetData( _
   ByVal Name As String _
) As IDataReader
[C#]
public IDataReader GetData(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetData Overload List


GetDataTypeName Method

CSLA .NET

SafeDataReader.GetDataTypeName Method

Invokes the GetDataTypeName method of the underlying datareader.

Overload List

Invokes the GetDataTypeName method of the underlying datareader.

public string GetDataTypeName(int);

Invokes the GetDataTypeName method of the underlying datareader.

public string GetDataTypeName(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetDataTypeName Method (Int32)

Invokes the GetDataTypeName method of the underlying datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetDataTypeName( _
   ByVal i As Integer _
) As String Implements _
   IDataRecord.GetDataTypeName
[C#]
public string GetDataTypeName(
int i
);

Implements

IDataRecord.GetDataTypeName

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDataTypeName Overload List


SafeDataReader.GetDataTypeName Method (String)

Invokes the GetDataTypeName method of the underlying datareader.

[Visual Basic]
Overloads Public Function GetDataTypeName( _
   ByVal Name As String _
) As String
[C#]
public string GetDataTypeName(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDataTypeName Overload List


GetDateTime Method

CSLA .NET

SafeDataReader.GetDateTime Method

Gets a date value from the datareader.

Overload List

Gets a date value from the datareader.

public DateTime GetDateTime(int);

Gets a date value from the datareader.

public DateTime GetDateTime(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetDateTime Method (Int32)

Gets a date value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetDateTime( _
   ByVal i As Integer _
) As Date Implements _
   IDataRecord.GetDateTime
[C#]
public DateTime GetDateTime(
int i
);

Implements

IDataRecord.GetDateTime

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDateTime Overload List


SafeDataReader.GetDateTime Method (String)

Gets a date value from the datareader.

[Visual Basic]
Overloads Public Function GetDateTime( _
   ByVal Name As String _
) As Date
[C#]
public DateTime GetDateTime(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDateTime Overload List


GetDecimal Method

CSLA .NET

SafeDataReader.GetDecimal Method

Gets a decimal value from the datareader.

Overload List

Gets a decimal value from the datareader.

public decimal GetDecimal(int);

Gets a decimal value from the datareader.

public decimal GetDecimal(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetDecimal Method (Int32)

Gets a decimal value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetDecimal( _
   ByVal i As Integer _
) As Decimal Implements _
   IDataRecord.GetDecimal
[C#]
public decimal GetDecimal(
int i
);

Implements

IDataRecord.GetDecimal

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDecimal Overload List


SafeDataReader.GetDecimal Method (String)

Gets a decimal value from the datareader.

[Visual Basic]
Overloads Public Function GetDecimal( _
   ByVal Name As String _
) As Decimal
[C#]
public decimal GetDecimal(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDecimal Overload List


GetDouble Method

CSLA .NET

SafeDataReader.GetDouble Method

Gets a double from the datareader.

Overload List

Gets a double from the datareader.

public double GetDouble(int);

Gets a double from the datareader.

public double GetDouble(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetDouble Method (Int32)

Gets a double from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetDouble( _
   ByVal i As Integer _
) As Double Implements _
   IDataRecord.GetDouble
[C#]
public double GetDouble(
int i
);

Implements

IDataRecord.GetDouble

Remarks

Returns 0 for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDouble Overload List


SafeDataReader.GetDouble Method (String)

Gets a double from the datareader.

[Visual Basic]
Overloads Public Function GetDouble( _
   ByVal Name As String _
) As Double
[C#]
public double GetDouble(
string Name
);

Remarks

Returns 0 for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetDouble Overload List


GetFieldType Method

CSLA .NET

SafeDataReader.GetFieldType Method

Invokes the GetFieldType method of the underlying datareader.

Overload List

Invokes the GetFieldType method of the underlying datareader.

public Type GetFieldType(int);

Invokes the GetFieldType method of the underlying datareader.

public Type GetFieldType(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetFieldType Method (Int32)

Invokes the GetFieldType method of the underlying datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetFieldType( _
   ByVal i As Integer _
) As Type Implements _
   IDataRecord.GetFieldType
[C#]
public Type GetFieldType(
int i
);

Implements

IDataRecord.GetFieldType

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetFieldType Overload List


SafeDataReader.GetFieldType Method (String)

Invokes the GetFieldType method of the underlying datareader.

[Visual Basic]
Overloads Public Function GetFieldType( _
   ByVal Name As String _
) As Type
[C#]
public Type GetFieldType(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetFieldType Overload List


GetFloat Method

CSLA .NET

SafeDataReader.GetFloat Method

Gets a Single value from the datareader.

Overload List

Gets a Single value from the datareader.

public float GetFloat(int);

Gets a Single value from the datareader.

public float GetFloat(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetFloat Method (Int32)

Gets a Single value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetFloat( _
   ByVal i As Integer _
) As Single Implements _
   IDataRecord.GetFloat
[C#]
public float GetFloat(
int i
);

Implements

IDataRecord.GetFloat

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetFloat Overload List


SafeDataReader.GetFloat Method (String)

Gets a Single value from the datareader.

[Visual Basic]
Overloads Public Function GetFloat( _
   ByVal Name As String _
) As Single
[C#]
public float GetFloat(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetFloat Overload List


GetGuid Method

CSLA .NET

SafeDataReader.GetGuid Method

Gets a Guid value from the datareader.

Overload List

Gets a Guid value from the datareader.

public Guid GetGuid(int);

Gets a Guid value from the datareader.

public Guid GetGuid(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetGuid Method (Int32)

Gets a Guid value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetGuid( _
   ByVal i As Integer _
) As Guid Implements _
   IDataRecord.GetGuid
[C#]
public Guid GetGuid(
int i
);

Implements

IDataRecord.GetGuid

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetGuid Overload List


SafeDataReader.GetGuid Method (String)

Gets a Guid value from the datareader.

[Visual Basic]
Overloads Public Function GetGuid( _
   ByVal Name As String _
) As Guid
[C#]
public Guid GetGuid(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetGuid Overload List


GetInt16 Method

CSLA .NET

SafeDataReader.GetInt16 Method

Gets a Short value from the datareader.

Overload List

Gets a Short value from the datareader.

public short GetInt16(int);

Gets a Short value from the datareader.

public short GetInt16(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetInt16 Method (Int32)

Gets a Short value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetInt16( _
   ByVal i As Integer _
) As Short Implements _
   IDataRecord.GetInt16
[C#]
public short GetInt16(
int i
);

Implements

IDataRecord.GetInt16

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetInt16 Overload List


SafeDataReader.GetInt16 Method (String)

Gets a Short value from the datareader.

[Visual Basic]
Overloads Public Function GetInt16( _
   ByVal Name As String _
) As Short
[C#]
public short GetInt16(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetInt16 Overload List


GetInt32 Method

CSLA .NET

SafeDataReader.GetInt32 Method

Gets an integer from the datareader.

Overload List

Gets an integer from the datareader.

public int GetInt32(int);

Gets an integer from the datareader.

public int GetInt32(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetInt32 Method (Int32)

Gets an integer from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetInt32( _
   ByVal i As Integer _
) As Integer Implements _
   IDataRecord.GetInt32
[C#]
public int GetInt32(
int i
);

Implements

IDataRecord.GetInt32

Remarks

Returns 0 for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetInt32 Overload List


SafeDataReader.GetInt32 Method (String)

Gets an integer from the datareader.

[Visual Basic]
Overloads Public Function GetInt32( _
   ByVal Name As String _
) As Integer
[C#]
public int GetInt32(
string Name
);

Remarks

Returns 0 for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetInt32 Overload List


GetInt64 Method

CSLA .NET

SafeDataReader.GetInt64 Method

Gets a Long value from the datareader.

Overload List

Gets a Long value from the datareader.

public long GetInt64(int);

Gets a Long value from the datareader.

public long GetInt64(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetInt64 Method (Int32)

Gets a Long value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetInt64( _
   ByVal i As Integer _
) As Long Implements _
   IDataRecord.GetInt64
[C#]
public long GetInt64(
int i
);

Implements

IDataRecord.GetInt64

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetInt64 Overload List


SafeDataReader.GetInt64 Method (String)

Gets a Long value from the datareader.

[Visual Basic]
Overloads Public Function GetInt64( _
   ByVal Name As String _
) As Long
[C#]
public long GetInt64(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetInt64 Overload List


SafeDataReader.GetName Method

Invokes the GetName method of the underlying datareader.

[Visual Basic]
NotOverridable Public Function GetName( _
   ByVal i As Integer _
) As String Implements _
   IDataRecord.GetName
[C#]
public string GetName(
int i
);

Implements

IDataRecord.GetName

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetOrdinal Method

Gets an ordinal value from the datareader.

[Visual Basic]
NotOverridable Public Function GetOrdinal( _
   ByVal name As String _
) As Integer Implements _
   IDataRecord.GetOrdinal
[C#]
public int GetOrdinal(
string name
);

Implements

IDataRecord.GetOrdinal

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetSchemaTable Method

Invokes the GetSchemaTable method of the underlying datareader.

[Visual Basic]
NotOverridable Public Function GetSchemaTable() As DataTable Implements _
   IDataReader.GetSchemaTable
[C#]
public DataTable GetSchemaTable();

Implements

IDataReader.GetSchemaTable

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


GetSmartDate Method

CSLA .NET

SafeDataReader.GetSmartDate Method

Gets a SmartDate from the datareader.

Overload List

Gets a SmartDate from the datareader.

public SmartDate GetSmartDate(int);

Gets a SmartDate from the datareader.

public SmartDate GetSmartDate(int,bool);

Gets a SmartDate from the datareader.

public SmartDate GetSmartDate(string);

Gets a SmartDate from the datareader.

public SmartDate GetSmartDate(string,bool);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetSmartDate Method (Int32)

Gets a SmartDate from the datareader.

[Visual Basic]
Overloads Public Function GetSmartDate( _
   ByVal i As Integer _
) As SmartDate
[C#]
public SmartDate GetSmartDate(
int i
);

Parameters

i
The column number within the datareader.

Remarks

A null is converted into the min possible date See Chapter 5 for more details on the SmartDate class.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetSmartDate Overload List


SafeDataReader.GetSmartDate Method (Int32, Boolean)

Gets a SmartDate from the datareader.

[Visual Basic]
Overloads Public Function GetSmartDate( _
   ByVal i As Integer, _
   ByVal MinIsEmpty As Boolean _
) As SmartDate
[C#]
public SmartDate GetSmartDate(
int i,
bool MinIsEmpty
);

Parameters

i
The column number within the datareader.
MinIsEmpty
A flag indicating whether the min or max value of a data means an empty date.

Remarks

A null is converted into either the min or max possible date depending on the MinIsEmpty parameter. See Chapter 5 for more details on the SmartDate class.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetSmartDate Overload List


SafeDataReader.GetSmartDate Method (String)

Gets a SmartDate from the datareader.

[Visual Basic]
Overloads Public Function GetSmartDate( _
   ByVal Name As String _
) As SmartDate
[C#]
public SmartDate GetSmartDate(
string Name
);

Parameters

Name

Remarks

A null is converted into min possible date See Chapter 5 for more details on the SmartDate class.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetSmartDate Overload List


SafeDataReader.GetSmartDate Method (String, Boolean)

Gets a SmartDate from the datareader.

[Visual Basic]
Overloads Public Function GetSmartDate( _
   ByVal Name As String, _
   ByVal MinIsEmpty As Boolean _
) As SmartDate
[C#]
public SmartDate GetSmartDate(
string Name,
bool MinIsEmpty
);

Parameters

Name
MinIsEmpty
A flag indicating whether the min or max value of a data means an empty date.

Remarks

A null is converted into either the min or max possible date depending on the MinIsEmpty parameter. See Chapter 5 for more details on the SmartDate class.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetSmartDate Overload List


GetString Method

CSLA .NET

SafeDataReader.GetString Method

Gets a string value from the datareader.

Overload List

Gets a string value from the datareader.

public string GetString(int);

Gets a string value from the datareader.

public string GetString(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetString Method (Int32)

Gets a string value from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetString( _
   ByVal i As Integer _
) As String Implements _
   IDataRecord.GetString
[C#]
public string GetString(
int i
);

Implements

IDataRecord.GetString

Remarks

Returns empty string for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetString Overload List


SafeDataReader.GetString Method (String)

Gets a string value from the datareader.

[Visual Basic]
Overloads Public Function GetString( _
   ByVal Name As String _
) As String
[C#]
public string GetString(
string Name
);

Remarks

Returns "" for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetString Overload List


GetValue Method

CSLA .NET

SafeDataReader.GetValue Method

Gets a value of type System.Object from the datareader.

Overload List

Gets a value of type System.Object from the datareader.

public object GetValue(int);

Gets a value of type System.Object from the datareader.

public object GetValue(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.GetValue Method (Int32)

Gets a value of type System.Object from the datareader.

[Visual Basic]
NotOverridable Overloads Public Function GetValue( _
   ByVal i As Integer _
) As Object Implements _
   IDataRecord.GetValue
[C#]
public object GetValue(
int i
);

Implements

IDataRecord.GetValue

Remarks

Returns Nothing for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetValue Overload List


SafeDataReader.GetValue Method (String)

Gets a value of type System.Object from the datareader.

[Visual Basic]
Overloads Public Function GetValue( _
   ByVal Name As String _
) As Object
[C#]
public object GetValue(
string Name
);

Remarks

Returns Nothing for null.

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.GetValue Overload List


SafeDataReader.GetValues Method

Invokes the GetValues method of the underlying datareader.

[Visual Basic]
NotOverridable Public Function GetValues( _
   ByVal values As Object() _
) As Integer Implements _
   IDataRecord.GetValues
[C#]
public int GetValues(
object[] values
);

Implements

IDataRecord.GetValues

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


IsDBNull Method

CSLA .NET

SafeDataReader.IsDBNull Method

Invokes the IsDBNull method of the underlying datareader.

Overload List

Invokes the IsDBNull method of the underlying datareader.

public bool IsDBNull(int);

Invokes the IsDBNull method of the underlying datareader.

public bool IsDBNull(string);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.IsDBNull Method (Int32)

Invokes the IsDBNull method of the underlying datareader.

[Visual Basic]
NotOverridable Overloads Public Function IsDBNull( _
   ByVal i As Integer _
) As Boolean Implements _
   IDataRecord.IsDBNull
[C#]
public bool IsDBNull(
int i
);

Implements

IDataRecord.IsDBNull

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.IsDBNull Overload List


SafeDataReader.IsDBNull Method (String)

Invokes the IsDBNull method of the underlying datareader.

[Visual Basic]
Overloads Public Function IsDBNull( _
   ByVal Name As String _
) As Boolean
[C#]
public bool IsDBNull(
string Name
);

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace | SafeDataReader.IsDBNull Overload List


SafeDataReader.NextResult Method

Moves to the next result set in the datareader.

[Visual Basic]
NotOverridable Public Function NextResult() As Boolean Implements _
   IDataReader.NextResult
[C#]
public bool NextResult();

Implements

IDataReader.NextResult

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


SafeDataReader.Read Method

Reads the next row of data from the datareader.

[Visual Basic]
NotOverridable Public Function Read() As Boolean Implements _
   IDataReader.Read
[C#]
public bool Read();

Implements

IDataReader.Read

See Also

SafeDataReader Class | SafeDataReader Members | CSLA.Data Namespace


CSLA.Security

CSLA .NET

CSLA.Security Namespace

Namespace hierarchy

Classes

Class | Description
BusinessIdentity | Implements a custom Identity class that supports CSLA .NET data access via the DataPortal.
BusinessPrincipal | Implements a custom Principal class that is used by CSLA .NET for table-based security.


BusinessIdentity Class

Implements a custom Identity class that supports CSLA .NET data access via the DataPortal.

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

System.Object
ReadOnlyBase
BusinessIdentity

[Visual Basic]
Public Class BusinessIdentity
Inherits ReadOnlyBase
Implements IIdentity
[C#]
public class BusinessIdentity : ReadOnlyBase, IIdentity

Requirements

Namespace: CSLA.Security Namespace

Assembly: CSLA.dll

See Also

BusinessIdentity Members | CSLA.Security Namespace


BusinessIdentity Members

Public Instance Properties

AuthenticationType | Implements the AuthenticationType property defined by IIdentity.
IsAuthenticated | Implements the IsAuthenticated property defined by IIdentity.
Name | Implements the Name property defined by IIdentity.

Public Instance Methods

Clone (inherited from ReadOnlyBase) | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

DataPortal_Fetch | Retrieves the identity data for a specific user.
DB (inherited from ReadOnlyBase) | Returns the specified database connection string from the application configuration file.
Deserialized (inherited from ReadOnlyBase) | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
Serialized (inherited from ReadOnlyBase) | This method is called on the original instance of the object after it has been serialized.
Serializing (inherited from ReadOnlyBase) | This method is called before an object is serialized.

See Also

BusinessIdentity Class | CSLA.Security Namespace


BusinessIdentity Properties

The properties of the BusinessIdentity class are listed below. For a complete list of BusinessIdentity class members, see the BusinessIdentity Members topic.

Public Instance Properties

AuthenticationType | Implements the AuthenticationType property defined by IIdentity.
IsAuthenticated | Implements the IsAuthenticated property defined by IIdentity.
Name | Implements the Name property defined by IIdentity.

See Also

BusinessIdentity Class | CSLA.Security Namespace


BusinessIdentity.AuthenticationType Property

Implements the AuthenticationType property defined by IIdentity.

[Visual Basic]
NotOverridable Public ReadOnly Property AuthenticationType As String Implements _
IIdentity.AuthenticationType
[C#]
public string AuthenticationType {get;}

Implements

IIdentity.AuthenticationType

See Also

BusinessIdentity Class | BusinessIdentity Members | CSLA.Security Namespace


BusinessIdentity.IsAuthenticated Property

Implements the IsAuthenticated property defined by IIdentity.

[Visual Basic]
NotOverridable Public ReadOnly Property IsAuthenticated As Boolean Implements _
IIdentity.IsAuthenticated
[C#]
public bool IsAuthenticated {get;}

Implements

IIdentity.IsAuthenticated

See Also

BusinessIdentity Class | BusinessIdentity Members | CSLA.Security Namespace


BusinessIdentity.Name Property

Implements the Name property defined by IIdentity.

[Visual Basic]
NotOverridable Public ReadOnly Property Name As String Implements _
IIdentity.Name
[C#]
public string Name {get;}

Implements

IIdentity.Name

See Also

BusinessIdentity Class | BusinessIdentity Members | CSLA.Security Namespace


BusinessIdentity Methods

The methods of the BusinessIdentity class are listed below. For a complete list of BusinessIdentity class members, see the BusinessIdentity Members topic.

Public Instance Methods

Clone (inherited from ReadOnlyBase) | Creates a clone of the object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

DataPortal_Fetch | Retrieves the identity data for a specific user.
DB (inherited from ReadOnlyBase) | Returns the specified database connection string from the application configuration file.
Deserialized (inherited from ReadOnlyBase) | This method is called on a newly deserialized object after deserialization is complete.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
Serialized (inherited from ReadOnlyBase) | This method is called on the original instance of the object after it has been serialized.
Serializing (inherited from ReadOnlyBase) | This method is called before an object is serialized.

See Also

BusinessIdentity Class | CSLA.Security Namespace


BusinessIdentity.DataPortal_Fetch Method

Retrieves the identity data for a specific user.

[Visual Basic]
Overrides Protected Sub DataPortal_Fetch( _
   ByVal Criteria As Object _
)
[C#]
protected override void DataPortal_Fetch(
object Criteria
);

See Also

BusinessIdentity Class | BusinessIdentity Members | CSLA.Security Namespace


BusinessPrincipal Class

Implements a custom Principal class that is used by CSLA .NET for table-based security.

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

System.Object
BusinessPrincipal

[Visual Basic]
Public Class BusinessPrincipal
Implements IPrincipal
[C#]
public class BusinessPrincipal : IPrincipal

Requirements

Namespace: CSLA.Security Namespace

Assembly: CSLA.dll

See Also

BusinessPrincipal Members | CSLA.Security Namespace


BusinessPrincipal Members

Public Static (Shared) Methods

Login Initiates a login process using custom CSLA .NET security.

Public Instance Properties

Identity Implements the Identity property defined by IPrincipal.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsInRole | Implements the IsInRole property defined by IPrincipal.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BusinessPrincipal Class | CSLA.Security Namespace


BusinessPrincipal Properties

The properties of the BusinessPrincipal class are listed below. For a complete list of BusinessPrincipal class members, see the BusinessPrincipal Members topic.

Public Instance Properties

Identity Implements the Identity property defined by IPrincipal.

See Also

BusinessPrincipal Class | CSLA.Security Namespace


BusinessPrincipal.Identity Property

Implements the Identity property defined by IPrincipal.

[Visual Basic]
NotOverridable Public ReadOnly Property Identity As IIdentity Implements _
IPrincipal.Identity
[C#]
public System.Security.Principal.IIdentity Identity {get;}

Implements

IPrincipal.Identity

See Also

BusinessPrincipal Class | BusinessPrincipal Members | CSLA.Security Namespace


BusinessPrincipal Methods

The methods of the BusinessPrincipal class are listed below. For a complete list of BusinessPrincipal class members, see the BusinessPrincipal Members topic.

Public Static (Shared) Methods

Login Initiates a login process using custom CSLA .NET security.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsInRole | Implements the IsInRole property defined by IPrincipal.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BusinessPrincipal Class | CSLA.Security Namespace


BusinessPrincipal.IsInRole Method

Implements the IsInRole property defined by IPrincipal.

[Visual Basic]
NotOverridable Public Function IsInRole( _
   ByVal Role As String _
) As Boolean Implements _
   IPrincipal.IsInRole
[C#]
public bool IsInRole(
string Role
);

Implements

IPrincipal.IsInRole

See Also

BusinessPrincipal Class | BusinessPrincipal Members | CSLA.Security Namespace


BusinessPrincipal.Login Method

Initiates a login process using custom CSLA .NET security.

[Visual Basic]
Public Shared Sub Login( _
   ByVal Username As String, _
   ByVal Password As String _
)
[C#]
public static void Login(
string Username,
string Password
);

Parameters

Username
The user's username.
Password
The user's password.

Remarks

As described in the book, this invokes a login process using a table-based authentication scheme and a list of roles in the database tables. By replacing the code in BusinessIdentity you can easily adapt this scheme to authenticate the user against any database or other scheme.

See Also

BusinessPrincipal Class | BusinessPrincipal Members | CSLA.Security Namespace


CSLA.Serialization

CSLA .NET

CSLA.Serialization Namespace

Namespace hierarchy

Classes

Class | Description
SerializationNotification | Helper methods for invoking the ISerializatoinNotification methods.

Interfaces

Interface | Description
ISerializationNotification | Objects can implement this interface if they wish to be notified of serialization events.


ISerializationNotification Interface

Objects can implement this interface if they wish to be notified of serialization events.

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

[Visual Basic]
Public Interface ISerializationNotification
[C#]
public interface ISerializationNotification

Remarks

Note that .NET serialization does NOT call these methods. Only code that checks for the ISerializationNotification interface when serializating and deserializing objects will invoke these methods.

The CSLA .NET framework's DataPortal processing and the Clone method in BusinessBase automatically make these calls.

Requirements

Namespace: CSLA.Serialization Namespace

Assembly: CSLA.Server.DataPortal.dll

See Also

ISerializationNotification Members | CSLA.Serialization Namespace


ISerializationNotification Members

Public Instance Methods

Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

See Also

ISerializationNotification Interface | CSLA.Serialization Namespace


ISerializationNotification Methods

The methods of the ISerializationNotification interface are listed below. For a complete list of ISerializationNotification interface members, see the ISerializationNotification Members topic.

Public Instance Methods

Deserialized | This method is called on a newly deserialized object after deserialization is complete.
Serialized | This method is called on the original instance of the object after it has been serialized.
Serializing | This method is called before an object is serialized.

See Also

ISerializationNotification Interface | CSLA.Serialization Namespace


ISerializationNotification.Deserialized Method

This method is called on a newly deserialized object after deserialization is complete.

[Visual Basic]
Sub Deserialized()
[C#]
void Deserialized();

See Also

ISerializationNotification Interface | ISerializationNotification Members | CSLA.Serialization Namespace


ISerializationNotification.Serialized Method

This method is called on the original instance of the object after it has been serialized.

[Visual Basic]
Sub Serialized()
[C#]
void Serialized();

See Also

ISerializationNotification Interface | ISerializationNotification Members | CSLA.Serialization Namespace


ISerializationNotification.Serializing Method

This method is called before an object is serialized.

[Visual Basic]
Sub Serializing()
[C#]
void Serializing();

See Also

ISerializationNotification Interface | ISerializationNotification Members | CSLA.Serialization Namespace


SerializationNotification Class

Helper methods for invoking the ISerializatoinNotification methods.

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

System.Object
SerializationNotification

[Visual Basic]
Public Class SerializationNotification
[C#]
public class SerializationNotification

Requirements

Namespace: CSLA.Serialization Namespace

Assembly: CSLA.Server.DataPortal.dll

See Also

SerializationNotification Members | CSLA.Serialization Namespace


SerializationNotification Members

Public Static (Shared) Methods

OnDeserialized | Invokes the Deserialized method on the target object if it has implemented ISerializationNotification.
OnSerialized | Invokes the Serialized method on the target object if it has implemented ISerializationNotification.
OnSerializing | Invokes the Serializing method on the target object if it has implemented ISerializationNotification.

Public Instance Constructors

SerializationNotification Constructor Initializes a new instance of the SerializationNotification class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SerializationNotification Class | CSLA.Serialization Namespace


SerializationNotification Constructor

Initializes a new instance of the SerializationNotification class.

[Visual Basic]
Public Sub New()
[C#]
public SerializationNotification();

See Also

SerializationNotification Class | SerializationNotification Members | CSLA.Serialization Namespace


SerializationNotification Methods

The methods of the SerializationNotification class are listed below. For a complete list of SerializationNotification class members, see the SerializationNotification Members topic.

Public Static (Shared) Methods

OnDeserialized | Invokes the Deserialized method on the target object if it has implemented ISerializationNotification.
OnSerialized | Invokes the Serialized method on the target object if it has implemented ISerializationNotification.
OnSerializing | Invokes the Serializing method on the target object if it has implemented ISerializationNotification.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SerializationNotification Class | CSLA.Serialization Namespace


SerializationNotification.OnDeserialized Method

Invokes the Deserialized method on the target object if it has implemented ISerializationNotification.

[Visual Basic]
Public Shared Sub OnDeserialized( _
   ByVal target As Object _
)
[C#]
public static void OnDeserialized(
object target
);

Parameters

target
Object on which the method should be invoked.

See Also

SerializationNotification Class | SerializationNotification Members | CSLA.Serialization Namespace


SerializationNotification.OnSerialized Method

Invokes the Serialized method on the target object if it has implemented ISerializationNotification.

[Visual Basic]
Public Shared Sub OnSerialized( _
   ByVal target As Object _
)
[C#]
public static void OnSerialized(
object target
);

Parameters

target
Object on which the method should be invoked.

See Also

SerializationNotification Class | SerializationNotification Members | CSLA.Serialization Namespace


SerializationNotification.OnSerializing Method

Invokes the Serializing method on the target object if it has implemented ISerializationNotification.

[Visual Basic]
Public Shared Sub OnSerializing( _
   ByVal target As Object _
)
[C#]
public static void OnSerializing(
object target
);

Parameters

target
Object on which the method should be invoked.

See Also

SerializationNotification Class | SerializationNotification Members | CSLA.Serialization Namespace


CSLA.Server

CSLA .NET

CSLA.Server Namespace

Namespace hierarchy

Classes

Class | Description
DataPortal | Implements the server-side DataPortal as discussed in Chapter 5.
DataPortalContext | Provides consistent context information between the client and server DataPortal objects.


DataPortal Class

Implements the server-side DataPortal as discussed in Chapter 5.

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

System.Object
MarshalByRefObject
DataPortal

[Visual Basic]
Public Class DataPortal
Inherits MarshalByRefObject
[C#]
public class DataPortal : MarshalByRefObject

Requirements

Namespace: CSLA.Server Namespace

Assembly: CSLA.Server.DataPortal.dll

See Also

DataPortal Members | CSLA.Server Namespace


DataPortal Members

Public Instance Constructors

DataPortal Constructor Initializes a new instance of the DataPortal class.

Public Instance Methods

Create | Called by the client-side DataPortal to create a new object.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Delete | Called by the client-side DataPortal to delete an object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fetch | Called by the client-side DataProtal to retrieve an object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Update | Called by the client-side DataPortal to update an object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DataPortal Class | CSLA.Server Namespace


DataPortal Constructor

Initializes a new instance of the DataPortal class.

[Visual Basic]
Public Sub New()
[C#]
public DataPortal();

See Also

DataPortal Class | DataPortal Members | CSLA.Server Namespace


DataPortal Methods

The methods of the DataPortal class are listed below. For a complete list of DataPortal class members, see the DataPortal Members topic.

Public Instance Methods

Create | Called by the client-side DataPortal to create a new object.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Delete | Called by the client-side DataPortal to delete an object.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fetch | Called by the client-side DataProtal to retrieve an object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Update | Called by the client-side DataPortal to update an object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DataPortal Class | CSLA.Server Namespace


DataPortal.Create Method

Called by the client-side DataPortal to create a new object.

[Visual Basic]
Public Function Create( _
   ByVal Criteria As Object, _
   ByVal context As DataPortalContext _
) As Object
[C#]
public object Create(
object Criteria,
DataPortalContext context
);

Parameters

Criteria
Object-specific criteria.
context

Return Value

A populated business object.

See Also

DataPortal Class | DataPortal Members | CSLA.Server Namespace


DataPortal.Delete Method

Called by the client-side DataPortal to delete an object.

[Visual Basic]
Public Sub Delete( _
   ByVal Criteria As Object, _
   ByVal context As DataPortalContext _
)
[C#]
public void Delete(
object Criteria,
DataPortalContext context
);

Parameters

Criteria
Object-specific criteria.
context

See Also

DataPortal Class | DataPortal Members | CSLA.Server Namespace


DataPortal.Fetch Method

Called by the client-side DataProtal to retrieve an object.

[Visual Basic]
Public Function Fetch( _
   ByVal Criteria As Object, _
   ByVal context As DataPortalContext _
) As Object
[C#]
public object Fetch(
object Criteria,
DataPortalContext context
);

Parameters

Criteria
Object-specific criteria.
context

Return Value

A populated business object.

See Also

DataPortal Class | DataPortal Members | CSLA.Server Namespace


DataPortal.Update Method

Called by the client-side DataPortal to update an object.

[Visual Basic]
Public Function Update( _
   ByVal obj As Object, _
   ByVal context As DataPortalContext _
) As Object
[C#]
public object Update(
object obj,
DataPortalContext context
);

Parameters

obj
A reference to the object being updated.
context

Return Value

A reference to the newly updated object.

See Also

DataPortal Class | DataPortal Members | CSLA.Server Namespace


DataPortalContext Class

Provides consistent context information between the client and server DataPortal objects.

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

System.Object
DataPortalContext

[Visual Basic]
Public Class DataPortalContext
[C#]
public class DataPortalContext

Remarks

The context includes the current BusinessPrincipal object if CSLA security is being used. It also includes a flag indicating whether the server-side DataPortal is running locally or remotely.

Requirements

Namespace: CSLA.Server Namespace

Assembly: CSLA.Server.DataPortal.dll

See Also

DataPortalContext Members | CSLA.Server Namespace


DataPortalContext Members

Public Instance Constructors

DataPortalContext Overloaded. Initialize a new instance of the DataPortalContext class.

Public Instance Properties

IsRemotePortal | Returns True if the server-side DataPortal is running on a remote server via remoting.
Principal | The current BusinessPrincipal if CSLA security is being used.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DataPortalContext Class | CSLA.Server Namespace


DataPortalContext Constructor

Creates a new DataPortalContext object.

Overload List

Creates a new DataPortalContext object.

public DataPortalContext(bool);

Creates a new DataPortalContext object.

public DataPortalContext(IPrincipal,bool);

See Also

DataPortalContext Class | DataPortalContext Members | CSLA.Server Namespace


DataPortalContext Constructor (Boolean)

Creates a new DataPortalContext object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal isRemotePortal As Boolean _
)
[C#]
public DataPortalContext(
bool isRemotePortal
);

Parameters

isRemotePortal
Indicates whether the DataPortal is remote.

See Also

DataPortalContext Class | DataPortalContext Members | CSLA.Server Namespace | DataPortalContext Constructor Overload List


DataPortalContext Constructor (IPrincipal, Boolean)

Creates a new DataPortalContext object.

[Visual Basic]
Overloads Public Sub New( _
   ByVal principal As IPrincipal, _
   ByVal isRemotePortal As Boolean _
)
[C#]
public DataPortalContext(
IPrincipal principal,
bool isRemotePortal
);

Parameters

principal
The current Principal object.
isRemotePortal
Indicates whether the DataPortal is remote.

See Also

DataPortalContext Class | DataPortalContext Members | CSLA.Server Namespace | DataPortalContext Constructor Overload List


DataPortalContext Properties

The properties of the DataPortalContext class are listed below. For a complete list of DataPortalContext class members, see the DataPortalContext Members topic.

Public Instance Properties

IsRemotePortal | Returns True if the server-side DataPortal is running on a remote server via remoting.
Principal | The current BusinessPrincipal if CSLA security is being used.

See Also

DataPortalContext Class | CSLA.Server Namespace


DataPortalContext.IsRemotePortal Property

Returns True if the server-side DataPortal is running on a remote server via remoting.

[Visual Basic]
Public ReadOnly Property IsRemotePortal As Boolean
[C#]
public bool IsRemotePortal {get;}

See Also

DataPortalContext Class | DataPortalContext Members | CSLA.Server Namespace


DataPortalContext.Principal Property

The current BusinessPrincipal if CSLA security is being used.

[Visual Basic]
Public ReadOnly Property Principal As IPrincipal
[C#]
public System.Security.Principal.IPrincipal Principal {get;}

See Also

DataPortalContext Class | DataPortalContext Members | CSLA.Server Namespace


CSLA.Server.ServicedDataPortal

CSLA .NET

CSLA.Server.ServicedDataPortal Namespace

Namespace hierarchy

Classes

Class | Description
DataPortal | Implements the transactional server-side DataPortal object as discussed in Chapter 5.


DataPortal Class

Implements the transactional server-side DataPortal object as discussed in Chapter 5.

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

System.Object
MarshalByRefObject
ContextBoundObject
ServicedComponent
DataPortal

[Visual Basic]
Public Class DataPortal
Inherits ServicedComponent
[C#]
public class DataPortal : ServicedComponent

Requirements

Namespace: CSLA.Server.ServicedDataPortal Namespace

Assembly: CSLA.Server.ServicedDataPortal.dll

See Also

DataPortal Members | CSLA.Server.ServicedDataPortal Namespace


DataPortal Members

Public Instance Constructors

DataPortal Constructor Initializes a new instance of the DataPortal class.

Public Instance Methods

Create | Invokes the server-side DataPortal Create method within a COM+ transaction.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Delete | Invokes the server-side DataPortal Delete method within a COM+ transaction.
Dispose (inherited from ServicedComponent) | Releases all resources used by the ServicedComponent .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fetch | Invokes the server-side DataPortal Fetch method within a COM+ transaction.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Update | Invokes the server-side DataPortal Update method within a COM+ transaction.

Protected Instance Methods

Dispose (inherited from ServicedComponent) | Releases the unmanaged resources used by the ServicedComponent and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Protected Internal Instance Methods

Activate (inherited from ServicedComponent) | This method is called by the infrastructure when the object is created or allocated from a pool. Override this method to add custom initialization code to objects.
CanBePooled (inherited from ServicedComponent) | This method is called by the infrastructure before the object is put back into the pool. Override this method to vote on whether the object is put back into the pool.
Construct (inherited from ServicedComponent) | This method is called by the infrastructure just after the constructor is called, passing in the constructor string. Override this method to make use of the construction string value.
Deactivate (inherited from ServicedComponent) | This method is called by the infrastructure when the object is about to be deactivated. Override this method to add custom finalization code to objects when just-in-time (JIT) compiled code or object pooling is used.

Explicit Interface Implementations

IRemoteDispatch.RemoteDispatchAutoDone (inherited from ServicedComponent)
IRemoteDispatch.RemoteDispatchNotAutoDone (inherited from ServicedComponent)
IServicedComponentInfo.GetComponentInfo (inherited from ServicedComponent)

See Also

DataPortal Class | CSLA.Server.ServicedDataPortal Namespace


DataPortal Constructor

Initializes a new instance of the DataPortal class.

[Visual Basic]
Public Sub New()
[C#]
public DataPortal();

See Also

DataPortal Class | DataPortal Members | CSLA.Server.ServicedDataPortal Namespace


DataPortal Methods

The methods of the DataPortal class are listed below. For a complete list of DataPortal class members, see the DataPortal Members topic.

Public Instance Methods

Create | Invokes the server-side DataPortal Create method within a COM+ transaction.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Delete | Invokes the server-side DataPortal Delete method within a COM+ transaction.
Dispose (inherited from ServicedComponent) | Releases all resources used by the ServicedComponent .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fetch | Invokes the server-side DataPortal Fetch method within a COM+ transaction.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Update | Invokes the server-side DataPortal Update method within a COM+ transaction.

Protected Instance Methods

Dispose (inherited from ServicedComponent) | Releases the unmanaged resources used by the ServicedComponent and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Protected Internal Instance Methods

Activate (inherited from ServicedComponent) | This method is called by the infrastructure when the object is created or allocated from a pool. Override this method to add custom initialization code to objects.
CanBePooled (inherited from ServicedComponent) | This method is called by the infrastructure before the object is put back into the pool. Override this method to vote on whether the object is put back into the pool.
Construct (inherited from ServicedComponent) | This method is called by the infrastructure just after the constructor is called, passing in the constructor string. Override this method to make use of the construction string value.
Deactivate (inherited from ServicedComponent) | This method is called by the infrastructure when the object is about to be deactivated. Override this method to add custom finalization code to objects when just-in-time (JIT) compiled code or object pooling is used.

Explicit Interface Implementations

IRemoteDispatch.RemoteDispatchAutoDone (inherited from ServicedComponent)
IRemoteDispatch.RemoteDispatchNotAutoDone (inherited from ServicedComponent)
IServicedComponentInfo.GetComponentInfo (inherited from ServicedComponent)

See Also

DataPortal Class | CSLA.Server.ServicedDataPortal Namespace


DataPortal.Create Method

Invokes the server-side DataPortal Create method within a COM+ transaction.

[Visual Basic]
Public Function Create( _
   ByVal Criteria As Object, _
   ByVal Principal As Object _
) As Object
[C#]
public object Create(
object Criteria,
object Principal
);

See Also

DataPortal Class | DataPortal Members | CSLA.Server.ServicedDataPortal Namespace


DataPortal.Delete Method

Invokes the server-side DataPortal Delete method within a COM+ transaction.

[Visual Basic]
Public Sub Delete( _
   ByVal Criteria As Object, _
   ByVal Principal As Object _
)
[C#]
public void Delete(
object Criteria,
object Principal
);

See Also

DataPortal Class | DataPortal Members | CSLA.Server.ServicedDataPortal Namespace


DataPortal.Fetch Method

Invokes the server-side DataPortal Fetch method within a COM+ transaction.

[Visual Basic]
Public Function Fetch( _
   ByVal Criteria As Object, _
   ByVal Principal As Object _
) As Object
[C#]
public object Fetch(
object Criteria,
object Principal
);

See Also

DataPortal Class | DataPortal Members | CSLA.Server.ServicedDataPortal Namespace


DataPortal.Update Method

Invokes the server-side DataPortal Update method within a COM+ transaction.

[Visual Basic]
Public Function Update( _
   ByVal obj As Object, _
   ByVal Principal As Object _
) As Object
[C#]
public object Update(
object obj,
object Principal
);

See Also

DataPortal Class | DataPortal Members | CSLA.Server.ServicedDataPortal Namespace


CSLA.BatchQueue.ServerHierarchy

CSLA .NET

CSLA.BatchQueue.Server Hierarchy

System.Object
-BatchEntry
-BatchQueueService
-MarshalByRefObject
-BatchQueue
-ContextBoundObject
-ServicedComponent
-DataPortal
-DataPortal


CSLA.BatchQueueHierarchy

CSLA .NET

CSLA.BatchQueue Hierarchy

System.Object
-BatchEntryInfo
-BatchJobRequest
-BatchQueue
-CollectionBase
-BatchEntries
-BindableCollectionBase
-RulesCollection
-SortableCollectionBase
-BusinessCollectionBase
-ReadOnlyCollectionBase
-DeletedCollection

Interfaces

IBatchEntry


CSLA.CoreHierarchy

CSLA .NET

CSLA.Core Hierarchy

System.Object
-BindableBase
-UndoableBase
-BusinessBase
-CollectionBase
-BatchEntries
-BindableCollectionBase
-RulesCollection
-SortableCollectionBase
-BusinessCollectionBase
-ReadOnlyCollectionBase
-DeletedCollection


CSLA.DataHierarchy

CSLA .NET

CSLA.Data Hierarchy

System.Object
-ObjectAdapter
-SafeDataReader


CSLA.SecurityHierarchy

CSLA .NET

CSLA.Security Hierarchy

System.Object
-BusinessPrincipal
-ReadOnlyBase
-BusinessIdentity


CSLA.SerializationHierarchy

CSLA .NET

CSLA.Serialization Hierarchy

System.Object
-SerializationNotification

Interfaces

ISerializationNotification


CSLA.Server.ServicedDataPortalHierarchy

CSLA .NET

CSLA.Server.ServicedDataPortal Hierarchy

System.Object
-MarshalByRefObject
-BatchQueue
-ContextBoundObject
-ServicedComponent
-DataPortal
-DataPortal


CSLA.ServerHierarchy

CSLA .NET

CSLA.Server Hierarchy

System.Object
-DataPortalContext
-MarshalByRefObject
-BatchQueue
-ContextBoundObject
-ServicedComponent
-DataPortal
-DataPortal


CSLAHierarchy

CSLA .NET

CSLA Hierarchy

System.Object
-Attribute
-DescriptionAttribute
-NotUndoableAttribute
-RunLocalAttribute
-TransactionalAttribute
-BindableBase
-UndoableBase
-BusinessBase
-BrokenRules
-RuleArgs
-CollectionBase
-BatchEntries
-BindableCollectionBase
-RulesCollection
-SortableCollectionBase
-BusinessCollectionBase
-ReadOnlyCollectionBase
-DeletedCollection
-CriteriaBase
-DataPortal
-Exception
-ApplicationException
-ValidationException
-NameObjectCollectionBase
-NameValueList
-ReadOnlyBase
-BusinessIdentity
-SmartDate
-ValueType