Craig's Utility Library  4.0 Beta
Utilities.ORM.ObjectBaseClass< ObjectType, IDType > Class Template Reference

Object base class helper. This is not required but automatically sets up basic functions and properties to simplify things a bit. More...

Inheritance diagram for Utilities.ORM.ObjectBaseClass< ObjectType, IDType >:
Utilities.ORM.Interfaces.IObject< IDType >

Public Member Functions

int CompareTo (object obj)
 Compares the object to another object More...
 
virtual int CompareTo (ObjectType other)
 Compares the object to another object More...
 
virtual void Delete ()
 Deletes the item More...
 
override bool Equals (object obj)
 Determines if two items are equal More...
 
override int GetHashCode ()
 Returns the hash of this item More...
 
virtual void Save ()
 Saves the item (if it already exists, it updates the item. Otherwise it inserts the item) More...
 
virtual void SetupObject ()
 Sets up the object for saving purposes More...
 

Static Public Member Functions

static IEnumerable< ObjectType > All (params IParameter[] Params)
 Loads the items based on type More...
 
static IEnumerable< ObjectType > All (string Command, CommandType Type, string ConnectionString, params object[] Params)
 Loads the items based on the criteria specified More...
 
static ObjectType Any (params IParameter[] Params)
 Loads the item based on the criteria specified More...
 
static ObjectType Any (string Command, CommandType Type, string ConnectionString, params object[] Params)
 Loads the item based on the criteria specified More...
 
static bool operator!= (ObjectBaseClass< ObjectType, IDType > first, ObjectBaseClass< ObjectType, IDType > second)
 != operator More...
 
static bool operator< (ObjectBaseClass< ObjectType, IDType > first, ObjectBaseClass< ObjectType, IDType > second)
 The < operator More...
 
static bool operator== (ObjectBaseClass< ObjectType, IDType > first, ObjectBaseClass< ObjectType, IDType > second)
 The == operator More...
 
static bool operator> (ObjectBaseClass< ObjectType, IDType > first, ObjectBaseClass< ObjectType, IDType > second)
 The > operator More...
 
static int PageCount (int PageSize=25, params IParameter[] Params)
 Gets the page count based on page size More...
 
static IEnumerable< ObjectType > Paged (int PageSize=25, int CurrentPage=0, string OrderBy="", params IParameter[] Params)
 Loads the items based on type More...
 
static void Save (IEnumerable< ObjectType > Objects)
 Saves a list of objects More...
 

Static Public Attributes

static EventHandler< LoadingEventArgsLoading
 Called prior to an object is loading More...
 

Protected Member Functions

 ObjectBaseClass ()
 Constructor More...
 
virtual void OnDeleted (DeletedEventArgs e)
 Called when the item is Deleted More...
 
virtual void OnDeleting (DeletingEventArgs e)
 Called when the item is Deleting More...
 
virtual void OnLoaded (LoadedEventArgs e)
 Called when the item is Loaded More...
 
virtual void OnLoading (LoadingEventArgs e)
 Called when the item is Loading More...
 
virtual void OnSaved (SavedEventArgs e)
 Called when the item is Saved More...
 
virtual void OnSaving (SavingEventArgs e)
 Called when the item is Saving More...
 

Static Protected Member Functions

static void OnLoading (object sender, LoadingEventArgs e)
 Called when the item is Loading More...
 

Properties

virtual bool Active [get, set]
 Is the object active? More...
 
virtual DateTime DateCreated [get, set]
 Date object was created More...
 
virtual DateTime DateModified [get, set]
 Date last modified More...
 
EventHandler< DeletedEventArgsDeleted [get, set]
 Called when the object is deleted More...
 
EventHandler< DeletingEventArgsDeleting [get, set]
 Called prior to an object is deleting More...
 
virtual IDType ID [get, set]
 ID for the object More...
 
EventHandler< LoadedEventArgsLoaded [get, set]
 Called prior to an object being loaded More...
 
EventHandler< SavedEventArgsSaved [get, set]
 Called when the object is saved More...
 
EventHandler< SavingEventArgsSaving [get, set]
 Called prior to an object is saving More...
 
- Properties inherited from Utilities.ORM.Interfaces.IObject< IDType >
bool Active [get, set]
 Is this item active? More...
 
DateTime DateCreated [get, set]
 Date created More...
 
DateTime DateModified [get, set]
 Date last modified More...
 
IDType ID [get, set]
 ID More...
 

Detailed Description

Object base class helper. This is not required but automatically sets up basic functions and properties to simplify things a bit.

Template Parameters
IDTypeID type
ObjectTypeObject type (must be the child object type)
Type Constraints
ObjectType :ObjectBaseClass 
ObjectType :ObjectType 
ObjectType :IDType 
ObjectType :new() 
IDType :IComparable 

Definition at line 40 of file ObjectBaseClass.cs.

Constructor & Destructor Documentation

Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.ObjectBaseClass ( )
protected

Constructor

Definition at line 47 of file ObjectBaseClass.cs.

Member Function Documentation

static IEnumerable<ObjectType> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.All ( params IParameter[]  Params)
static

Loads the items based on type

Parameters
ParamsParameters used to specify what to load
Returns
All items that fit the specified query

Definition at line 114 of file ObjectBaseClass.cs.

static IEnumerable<ObjectType> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.All ( string  Command,
CommandType  Type,
string  ConnectionString,
params object[]  Params 
)
static

Loads the items based on the criteria specified

Parameters
CommandCommand to run
TypeCommand type
ConnectionStringConnection string name
ParamsParameters used to specify what to load
Returns
The specified items

Definition at line 138 of file ObjectBaseClass.cs.

static ObjectType Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Any ( params IParameter[]  Params)
static

Loads the item based on the criteria specified

Parameters
ParamsParameters used to specify what to load
Returns
The specified item

Definition at line 159 of file ObjectBaseClass.cs.

static ObjectType Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Any ( string  Command,
CommandType  Type,
string  ConnectionString,
params object[]  Params 
)
static

Loads the item based on the criteria specified

Parameters
CommandCommand to run
TypeCommand type
ConnectionStringConnection string name
ParamsParameters used to specify what to load
Returns
The specified item

Definition at line 182 of file ObjectBaseClass.cs.

int Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.CompareTo ( object  obj)

Compares the object to another object

Parameters
objObject to compare to
Returns
0 if they are equal, -1 if this is smaller, 1 if it is larger

Definition at line 306 of file ObjectBaseClass.cs.

virtual int Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.CompareTo ( ObjectType  other)
virtual

Compares the object to another object

Parameters
otherObject to compare to
Returns
0 if they are equal, -1 if this is smaller, 1 if it is larger

Definition at line 318 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Delete ( )
virtual

Deletes the item

Definition at line 326 of file ObjectBaseClass.cs.

override bool Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Equals ( object  obj)

Determines if two items are equal

Parameters
objThe object to compare this to
Returns
true if they are the same, false otherwise

Definition at line 343 of file ObjectBaseClass.cs.

override int Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.GetHashCode ( )

Returns the hash of this item

Returns
the int hash of the item

Definition at line 354 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnDeleted ( DeletedEventArgs  e)
protectedvirtual

Called when the item is Deleted

Parameters
eDeletedEventArgs item

Definition at line 399 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnDeleting ( DeletingEventArgs  e)
protectedvirtual

Called when the item is Deleting

Parameters
eDeletingEventArgs item

Definition at line 408 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnLoaded ( LoadedEventArgs  e)
protectedvirtual

Called when the item is Loaded

Parameters
eLoadedEventArgs item

Definition at line 417 of file ObjectBaseClass.cs.

static void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnLoading ( object  sender,
LoadingEventArgs  e 
)
staticprotected

Called when the item is Loading

Parameters
eLoadingEventArgs item
senderSender item

Definition at line 390 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnLoading ( LoadingEventArgs  e)
protectedvirtual

Called when the item is Loading

Parameters
eLoadingEventArgs item

Definition at line 426 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnSaved ( SavedEventArgs  e)
protectedvirtual

Called when the item is Saved

Parameters
eSavedEventArgs item

Definition at line 435 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.OnSaving ( SavingEventArgs  e)
protectedvirtual

Called when the item is Saving

Parameters
eSavingEventArgs item

Definition at line 444 of file ObjectBaseClass.cs.

static bool Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.operator!= ( ObjectBaseClass< ObjectType, IDType >  first,
ObjectBaseClass< ObjectType, IDType >  second 
)
static

!= operator

Parameters
firstFirst item
secondSecond item
Returns
returns true if they are not equal, false otherwise

Definition at line 203 of file ObjectBaseClass.cs.

static bool Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.operator< ( ObjectBaseClass< ObjectType, IDType >  first,
ObjectBaseClass< ObjectType, IDType >  second 
)
static

The < operator

Parameters
firstFirst item
secondSecond item
Returns
True if the first item is less than the second, false otherwise

Definition at line 214 of file ObjectBaseClass.cs.

static bool Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.operator== ( ObjectBaseClass< ObjectType, IDType >  first,
ObjectBaseClass< ObjectType, IDType >  second 
)
static

The == operator

Parameters
firstFirst item
secondSecond item
Returns
true if the first and second item are the same, false otherwise

Definition at line 229 of file ObjectBaseClass.cs.

static bool Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.operator> ( ObjectBaseClass< ObjectType, IDType >  first,
ObjectBaseClass< ObjectType, IDType >  second 
)
static

The > operator

Parameters
firstFirst item
secondSecond item
Returns
True if the first item is greater than the second, false otherwise

Definition at line 246 of file ObjectBaseClass.cs.

static int Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.PageCount ( int  PageSize = 25,
params IParameter[]  Params 
)
static

Gets the page count based on page size

Parameters
PageSizePage size
ParamsParameters used to specify what to load
Returns
All items that fit the specified query

Definition at line 261 of file ObjectBaseClass.cs.

static IEnumerable<ObjectType> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Paged ( int  PageSize = 25,
int  CurrentPage = 0,
string  OrderBy = "",
params IParameter[]  Params 
)
static

Loads the items based on type

Parameters
PageSizePage size
CurrentPageCurrent page (0 based)
OrderByThe order by portion of the query
ParamsParameters used to specify what to load
Returns
All items that fit the specified query

Definition at line 274 of file ObjectBaseClass.cs.

static void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Save ( IEnumerable< ObjectType >  Objects)
static

Saves a list of objects

Parameters
ObjectsList of objects

Definition at line 294 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Save ( )
virtual

Saves the item (if it already exists, it updates the item. Otherwise it inserts the item)

Definition at line 362 of file ObjectBaseClass.cs.

virtual void Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.SetupObject ( )
virtual

Sets up the object for saving purposes

Definition at line 380 of file ObjectBaseClass.cs.

Member Data Documentation

EventHandler<LoadingEventArgs> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Loading
static

Called prior to an object is loading

Definition at line 107 of file ObjectBaseClass.cs.

Property Documentation

virtual bool Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Active
getset

Is the object active?

Definition at line 58 of file ObjectBaseClass.cs.

virtual DateTime Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.DateCreated
getset

Date object was created

Definition at line 65 of file ObjectBaseClass.cs.

virtual DateTime Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.DateModified
getset

Date last modified

Definition at line 72 of file ObjectBaseClass.cs.

EventHandler<DeletedEventArgs> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Deleted
getset

Called when the object is deleted

Definition at line 77 of file ObjectBaseClass.cs.

EventHandler<DeletingEventArgs> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Deleting
getset

Called prior to an object is deleting

Definition at line 82 of file ObjectBaseClass.cs.

virtual IDType Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.ID
getset

ID for the object

Definition at line 87 of file ObjectBaseClass.cs.

EventHandler<LoadedEventArgs> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Loaded
getset

Called prior to an object being loaded

Definition at line 92 of file ObjectBaseClass.cs.

EventHandler<SavedEventArgs> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Saved
getset

Called when the object is saved

Definition at line 97 of file ObjectBaseClass.cs.

EventHandler<SavingEventArgs> Utilities.ORM.ObjectBaseClass< ObjectType, IDType >.Saving
getset

Called prior to an object is saving

Definition at line 102 of file ObjectBaseClass.cs.


The documentation for this class was generated from the following file: