3,Schemaexplorer, Database access
CodesmithThe reason is that it provides convenient database access and calling. This part is actually a plug-in, that isSchemaexplorer.
schemaexplorer encapsulates all database objects. databaseschema and tableschema , columnschema and other databases schema , the data source information is extracted by dynamically loading Assembly , this function is implemented by the idbschemaprovider interface. Many components are provided on the codesmith website. v3.1 provides adoxschemaprovider and sqlschemaprovider , for ADO and SQL database access, similar to ADO. net oledbdataadpater and sqldataadpate R .
DatabaseschemaRepresents a database. AccordingConnnectionstringAndIdbschemaprovider. Its main attribute isTableschmeacollectionAndViewschemacollectionProvides the data table and data view information of the database.
TableschemaRepresents a database table. Mainly providesColumnschemacollection. That is, the column data of the data table.
ColumnschemaRepresents the columns of a data table. The main attribute isColumnname,Systemtype,Columntype,IsprimarykeymemberAnd other content
The above three categories are providedExtendedpropertycollectionStores extended information, which is similarHashtable,In addition, many databasesProviderThe special information of this type of database is also stored here.
In the template, You Can iterate over the above three collection classes to perform database stored procedures,ORMAnd so on.