프로퍼티 | 타입 | 설명 | |
---|---|---|---|
Errors | IList |
메소드 | 설명 | |
---|---|---|
All ( string where = "", string orderBy = "", int limit, string columns = "*" ) : IEnumerable |
Returns all records complying with the passed-in WHERE clause and arguments, ordered as specified, limited (TOP) by limit.
|
|
BeforeDelete ( dynamic item ) : bool | ||
BeforeSave ( dynamic item ) : bool | ||
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
|
|
CreateDeleteCommand ( string where = "", object key = null ) : DbCommand |
Removes one or more records from the DB according to the passed-in WHERE
|
|
CreateFrom ( NameValueCollection coll ) : dynamic |
Creates a new Expando from a Form POST - white listed against the columns in the DB
|
|
CreateInsertCommand ( dynamic expando ) : DbCommand | ||
CreateUpdateCommand ( dynamic expando, object key ) : DbCommand |
Creates a command for use with transactions - internal stuff mostly, but here for you to play with
|
|
DefaultTo ( string key, object value, dynamic item ) : void | ||
DefaultValue ( dynamic column ) : dynamic |
Gets a default value for the column
|
|
Delete ( object key = null, string where = "" ) : int |
Removes one or more records from the DB according to the passed-in WHERE
|
|
Deleted ( dynamic item ) : void | ||
DynamicModel ( ConnectionStringSettings connectionStringSettings, string tableName = "", string primaryKeyField = "" ) : System | ||
DynamicModel ( string connectionStringName, string tableName = "", string primaryKeyField = "", string descriptorField = "" ) : System | ||
Execute ( DbCommand command ) : int | ||
Execute ( IEnumerable |
Executes a series of DBCommands in a transaction
|
|
Execute ( string sql ) : int | ||
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 ) : dynamic |
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
|
|
Inserted ( dynamic item ) : void | ||
IsValid ( dynamic item ) : bool | ||
ItemAsDictionary ( ExpandoObject item ) : object>.IDictionary |
This will return an Expando as a Dictionary
|
|
ItemContainsKey ( string key, ExpandoObject item ) : bool | ||
KeyValues ( string orderBy = "" ) : object>.IDictionary |
This will return a string/object dictionary for dropdowns etc
|
|
Open ( ConnectionStringSettings connectionStringSettings ) : DynamicModel | ||
Open ( string connectionStringName ) : DynamicModel | ||
OpenConnection ( ) : DbConnection |
Returns and OpenConnection
|
|
Paged ( string where = "", string orderBy = "", string columns = "*", int pageSize = 20, int currentPage = 1 ) : dynamic |
Returns a dynamic PagedResult. Result properties are Items, TotalPages, and TotalRecords.
|
|
Paged ( string sql, string primaryKey, string where = "", string orderBy = "", string columns = "*", int pageSize = 20, int currentPage = 1 ) : dynamic | ||
Query ( string sql ) : IEnumerable |
Enumerates the reader yielding the result - thanks to Jeroen Haegebaert
|
|
Query ( string sql, DbConnection connection ) : IEnumerable |
||
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
|
|
Scalar ( string sql ) : object |
Returns a single result
|
|
Single ( object key, string columns = "*" ) : dynamic |
Returns a single row from the database
|
|
Single ( string where ) : dynamic |
Returns a single row from the database
|
|
TryInvokeMember ( InvokeMemberBinder binder, object args, object &result ) : bool |
A helpful query tool
|
|
Update ( object o, object key ) : 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
|
|
Updated ( dynamic item ) : void | ||
Validate ( dynamic item ) : void | ||
ValidateIsCurrency ( object value, string message = "Should be money" ) : void | ||
ValidatesNumericalityOf ( object value, string message = "Should be a number" ) : void | ||
ValidatesPresenceOf ( object value, string message = "Required" ) : void |
메소드 | 설명 | |
---|---|---|
BuildPagedResult ( string sql = "", string primaryKeyField = "", string where = "", string orderBy = "", string columns = "*", int pageSize = 20, int currentPage = 1 ) : dynamic | ||
BuildSelect ( string where, string orderBy, int limit ) : string | ||
CreateCommand ( string sql, DbConnection conn ) : DbCommand |
Creates a DBCommand that you can use for loving your database.
|
public All ( string where = "", string orderBy = "", int limit, string columns = "*" ) : IEnumerable |
||
where | string | |
orderBy | string | |
limit | int | |
columns | string | |
리턴 | IEnumerable |
public CreateDeleteCommand ( string where = "", object key = null ) : DbCommand | ||
where | string | |
key | object | |
리턴 | DbCommand |
public CreateFrom ( NameValueCollection coll ) : dynamic | ||
coll | NameValueCollection | |
리턴 | dynamic |
public CreateInsertCommand ( dynamic expando ) : DbCommand | ||
expando | dynamic | |
리턴 | DbCommand |
public CreateUpdateCommand ( dynamic expando, object key ) : DbCommand | ||
expando | dynamic | |
key | object | |
리턴 | DbCommand |
public DefaultTo ( string key, object value, dynamic item ) : void | ||
key | string | |
value | object | |
item | dynamic | |
리턴 | void |
public Delete ( object key = null, string where = "" ) : int | ||
key | object | |
where | string | |
리턴 | int |
public DynamicModel ( ConnectionStringSettings connectionStringSettings, string tableName = "", string primaryKeyField = "" ) : System | ||
connectionStringSettings | ConnectionStringSettings | |
tableName | string | |
primaryKeyField | string | |
리턴 | System |
public DynamicModel ( string connectionStringName, string tableName = "", string primaryKeyField = "", string descriptorField = "" ) : System | ||
connectionStringName | string | |
tableName | string | |
primaryKeyField | string | |
descriptorField | string | |
리턴 | System |
public ItemAsDictionary ( ExpandoObject item ) : object>.IDictionary |
||
item | ExpandoObject | |
리턴 | object>.IDictionary |
public ItemContainsKey ( string key, ExpandoObject item ) : bool | ||
key | string | |
item | ExpandoObject | |
리턴 | bool |
public KeyValues ( string orderBy = "" ) : object>.IDictionary |
||
orderBy | string | |
리턴 | object>.IDictionary |
public static Open ( ConnectionStringSettings connectionStringSettings ) : DynamicModel | ||
connectionStringSettings | ConnectionStringSettings | |
리턴 | DynamicModel |
public static Open ( string connectionStringName ) : DynamicModel | ||
connectionStringName | string | |
리턴 | DynamicModel |
public Paged ( string where = "", string orderBy = "", string columns = "*", int pageSize = 20, int currentPage = 1 ) : dynamic | ||
where | string | |
orderBy | string | |
columns | string | |
pageSize | int | |
currentPage | int | |
리턴 | dynamic |
public Paged ( string sql, string primaryKey, string where = "", string orderBy = "", string columns = "*", int pageSize = 20, int currentPage = 1 ) : dynamic | ||
sql | string | |
primaryKey | string | |
where | string | |
orderBy | string | |
columns | string | |
pageSize | int | |
currentPage | int | |
리턴 | dynamic |
public Query ( string sql, DbConnection connection ) : IEnumerable |
||
sql | string | |
connection | DbConnection | |
리턴 | IEnumerable |
public Single ( object key, string columns = "*" ) : dynamic | ||
key | object | |
columns | string | |
리턴 | dynamic |
public TryInvokeMember ( InvokeMemberBinder binder, object args, object &result ) : bool | ||
binder | InvokeMemberBinder | |
args | object | |
result | object | |
리턴 | bool |
public ValidateIsCurrency ( object value, string message = "Should be money" ) : void | ||
value | object | |
message | string | |
리턴 | void |
public ValidatesNumericalityOf ( object value, string message = "Should be a number" ) : void | ||
value | object | |
message | string | |
리턴 | void |
public ValidatesPresenceOf ( object value, string message = "Required" ) : void | ||
value | object | |
message | string | |
리턴 | void |