Method | Description | |
---|---|---|
All ( object where = null, string orderBy = "", int limit, object columns = null ) : IEnumerable |
Returns all records complying with the passed-in WHERE clause and arguments, ordered as specified, limited (TOP) by limit.
|
|
BuildCommands ( ) : List |
Builds a set of Insert and Update commands based on the passed-on objects. These objects can be POCOs, Anonymous, NameValueCollections, or Expandos. Objects With a PK property (whatever PrimaryKeyField is set to) will be created at UPDATEs
|
|
BuildCommandsWithWhitelist ( object whitelist ) : List |
Builds a set of Insert and Update commands based on the passed-on objects. These objects can be POCOs, Anonymous, NameValueCollections, or Expandos. Objects With a PK property (whatever PrimaryKeyField is set to) will be created at UPDATEs
|
|
Delete ( object key = null, object where = null ) : int |
Removes one or more records from the DB according to the passed-in WHERE
|
|
DynamicModel ( |
Initializes a new instance of the DynamicModel class.
|
|
DynamicModel ( string connectionStringName = "", string tableName = "", string primaryKeyField = "" ) : System |
Initializes a new instance of the DynamicModel class.
|
|
GetPrimaryKey ( object o ) : object |
If the object passed in has a property with the same name as your PrimaryKeyField it is returned here.
|
|
HasPrimaryKey ( object o ) : bool |
Conventionally introspects the object passed in for a field that looks like a PK. If you've named your PrimaryKeyField, this becomes easy
|
|
Insert ( object o, object whitelist = null ) : object |
Adds a record to the database. You can pass in an Anonymous object, an ExpandoObject, A regular old POCO, or a NameValueColletion from a Request.Form or Request.QueryString
|
|
Paged ( object where = null, string orderBy = "", object columns = null, int pageSize = 20, int currentPage = 1 ) : dynamic |
Returns a dynamic PagedResult. Result properties are Items, TotalPages, and TotalRecords.
|
|
Save ( ) : int |
Executes a set of objects as Insert or Update commands based on their property settings, within a transaction. These objects can be POCOs, Anonymous, NameValueCollections, or Expandos. Objects With a PK property (whatever PrimaryKeyField is set to) will be created at UPDATEs
|
|
SaveWithWhitelist ( object whitelist ) : int |
Executes a set of objects as Insert or Update commands based on their property settings, within a transaction. These objects can be POCOs, Anonymous, NameValueCollections, or Expandos. Objects With a PK property (whatever PrimaryKeyField is set to) will be created at UPDATEs
|
|
Single ( object key = null, object where = null, object columns = null ) : dynamic |
Returns a single row from the database
|
|
Update ( object o, object key, object whitelist = null ) : int |
Updates a record in the database. You can pass in an Anonymous object, an ExpandoObject, A regular old POCO, or a NameValueCollection from a Request.Form or Request.QueryString
|
Method | Description | |
---|---|---|
CreateDeleteCommand ( object key = null, object where = null ) : |
Removes one or more records from the DB according to the passed-in WHERE
|
|
CreateInsertCommand ( object o, object whitelist = null ) : |
Creates a command for use with transactions - internal stuff mostly, but here for you to play with
|
|
CreateUpdateCommand ( object o, object key, object whitelist = null ) : |
Creates a command for use with transactions - internal stuff mostly, but here for you to play with
|
Method | Description | |
---|---|---|
FilterItems ( object o, object whitelist ) : object>>.IEnumerable |
||
GetColumn ( string propertyName, string columnName ) : string | ||
GetColumns ( object columns ) : string | ||
GetContext ( string method ) : string | ||
GetWhereInfo ( object where, object key, IEnumerable | ||
MapPrimaryKey ( object o ) : string |
public All ( object where = null, string orderBy = "", int limit, object columns = null ) : IEnumerable |
||
where | object | |
orderBy | string | |
limit | int | |
columns | object | |
return | IEnumerable |
public BuildCommandsWithWhitelist ( object whitelist ) : List |
||
whitelist | object | |
return | List |
protected CreateDeleteCommand ( object key = null, object where = null ) : |
||
key | object | |
where | object | |
return |
protected CreateInsertCommand ( object o, object whitelist = null ) : |
||
o | object | |
whitelist | object | |
return |
protected CreateUpdateCommand ( object o, object key, object whitelist = null ) : |
||
o | object | |
key | object | |
whitelist | object | |
return |
public Delete ( object key = null, object where = null ) : int | ||
key | object | |
where | object | |
return | int |
public DynamicModel ( |
||
database | The database. | |
tableName | string | Name of the table. |
primaryKeyField | string | The primary key field. |
return | System |
public DynamicModel ( string connectionStringName = "", string tableName = "", string primaryKeyField = "" ) : System | ||
connectionStringName | string | Name of the connection string. |
tableName | string | Name of the table. |
primaryKeyField | string | The primary key field. |
return | System |
public Insert ( object o, object whitelist = null ) : object | ||
o | object | |
whitelist | object | |
return | object |
public Paged ( object where = null, string orderBy = "", object columns = null, int pageSize = 20, int currentPage = 1 ) : dynamic | ||
where | object | |
orderBy | string | |
columns | object | |
pageSize | int | |
currentPage | int | |
return | dynamic |
public SaveWithWhitelist ( object whitelist ) : int | ||
whitelist | object | |
return | int |
public Single ( object key = null, object where = null, object columns = null ) : dynamic | ||
key | object | |
where | object | |
columns | object | |
return | dynamic |
public Update ( object o, object key, object whitelist = null ) : int | ||
o | object | |
key | object | |
whitelist | object | |
return | int |