Highway Framework  Release 1.0.1.0
The fastest and smoothest way to great architecture
 All Classes Namespaces Functions Variables Properties Events
Public Member Functions | Properties
Highway.Data.Interfaces.IDataContext Interface Reference

The standard interface used to interact with an ORM specific implementation More...

Inheritance diagram for Highway.Data.Interfaces.IDataContext:
Highway.Data.Interfaces.IObservableDataContext Highway.Data.DataContext Highway.Data.ObjectDataContext

List of all members.

Public Member Functions

IQueryable< T > AsQueryable< T > ()
 This gives a mockable wrapper around normal Set method that allows for testablity
Add< T > (T item)
 Adds the provided instance of T to the data context
Remove< T > (T item)
 Removes the provided instance of T from the data context
Update< T > (T item)
 Updates the provided instance of T in the data context
Attach< T > (T item)
 Attaches the provided instance of T to the data context
Detach< T > (T item)
 Detaches the provided instance of T from the data context
Reload< T > (T item)
 Reloads the provided instance of T from the database
int Commit ()
 Commits all currently tracked entity changes
IEnumerable< T > ExecuteSqlQuery< T > (string sql, params DbParameter[] dbParams)
 Executes a SQL command and tries to map the returned datasets into an IEnumerable{T} The results should have the same column names as the Entity Type has properties
int ExecuteSqlCommand (string sql, params DbParameter[] dbParams)
 Executes a SQL command and returns the standard int return from the query
int ExecuteFunction (string procedureName, params ObjectParameter[] dbParams)
 

Properties

IEventManager EventManager [get, set]
 The reference to EventManager that allows for ordered event handling and registration

Detailed Description

The standard interface used to interact with an ORM specific implementation


Member Function Documentation

T Highway.Data.Interfaces.IDataContext.Add< T > ( item)

Adds the provided instance of T to the data context

Template Parameters:
TThe Entity Type being added
Parameters:
itemThe T you want to add
Returns:
The T you added

Implemented in Highway.Data.ObjectDataContext, and Highway.Data.DataContext.

Type Constraints
T :class 
IQueryable<T> Highway.Data.Interfaces.IDataContext.AsQueryable< T > ( )

This gives a mockable wrapper around normal Set method that allows for testablity

Template Parameters:
TThe Entity being queried
Returns:
IQueryable{T}

Implemented in Highway.Data.ObjectDataContext, and Highway.Data.DataContext.

Type Constraints
T :class 
T Highway.Data.Interfaces.IDataContext.Attach< T > ( item)

Attaches the provided instance of T to the data context

Template Parameters:
TThe Entity Type being attached
Parameters:
itemThe T you want to attach
Returns:
The T you attached

Implemented in Highway.Data.ObjectDataContext, and Highway.Data.DataContext.

Type Constraints
T :class 
int Highway.Data.Interfaces.IDataContext.Commit ( )

Commits all currently tracked entity changes

Returns:
the number of rows affected

Implemented in Highway.Data.DataContext, and Highway.Data.ObjectDataContext.

T Highway.Data.Interfaces.IDataContext.Detach< T > ( item)

Detaches the provided instance of T from the data context

Template Parameters:
TThe Entity Type being detached
Parameters:
itemThe T you want to detach
Returns:
The T you detached

Implemented in Highway.Data.ObjectDataContext, and Highway.Data.DataContext.

Type Constraints
T :class 
int Highway.Data.Interfaces.IDataContext.ExecuteFunction ( string  procedureName,
params ObjectParameter[]  dbParams 
)

Parameters:
procedureName
dbParams
Returns:

Implemented in Highway.Data.DataContext.

int Highway.Data.Interfaces.IDataContext.ExecuteSqlCommand ( string  sql,
params DbParameter[]  dbParams 
)

Executes a SQL command and returns the standard int return from the query

Parameters:
sqlThe Sql Statement
dbParamsA List of Database Parameters for the Query
Returns:
The rows affected

Implemented in Highway.Data.DataContext, and Highway.Data.ObjectDataContext.

IEnumerable<T> Highway.Data.Interfaces.IDataContext.ExecuteSqlQuery< T > ( string  sql,
params DbParameter[]  dbParams 
)

Executes a SQL command and tries to map the returned datasets into an IEnumerable{T} The results should have the same column names as the Entity Type has properties

Template Parameters:
TThe Entity Type that the return should be mapped to
Parameters:
sqlThe Sql Statement
dbParamsA List of Database Parameters for the Query
Returns:
An IEnumerable{T} from the query return

Implemented in Highway.Data.DataContext, and Highway.Data.ObjectDataContext.

T Highway.Data.Interfaces.IDataContext.Reload< T > ( item)

Reloads the provided instance of T from the database

Template Parameters:
TThe Entity Type being reloaded
Parameters:
itemThe T you want to reload
Returns:
The T you reloaded

Implemented in Highway.Data.DataContext, and Highway.Data.ObjectDataContext.

Type Constraints
T :class 
T Highway.Data.Interfaces.IDataContext.Remove< T > ( item)

Removes the provided instance of T from the data context

Template Parameters:
TThe Entity Type being removed
Parameters:
itemThe T you want to remove
Returns:
The T you removed

Implemented in Highway.Data.ObjectDataContext, and Highway.Data.DataContext.

Type Constraints
T :class 
T Highway.Data.Interfaces.IDataContext.Update< T > ( item)

Updates the provided instance of T in the data context

Template Parameters:
TThe Entity Type being updated
Parameters:
itemThe T you want to update
Returns:
The T you updated

Implemented in Highway.Data.ObjectDataContext, and Highway.Data.DataContext.

Type Constraints
T :class 

Property Documentation

IEventManager Highway.Data.Interfaces.IDataContext.EventManager
getset

The reference to EventManager that allows for ordered event handling and registration

Implemented in Highway.Data.DataContext, and Highway.Data.ObjectDataContext.


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