Dapper. Rainbow is simple to use and dapper. rainbow is used
1. Dapper Introduction A highly efficient micro-ORM. 2. Dapper. Rainbow Dapper extensions implement Dynamic insertion and update in this extension, which is useful for Dynamic objects and can be used to create fewer anemia entity classes. 3. Dynamic is a double-edged sword, which increases efficiency and increases the chance of errors. It is necessary to use it properly. Iv. Use of Dapper. Rainbow
// Api name public virtual long Insert ([Dynamic] dynamic data); public long InsertOrUpdate ([Dynamic] dynamic data); public int Update (TId id, [Dynamic] dynamic data); // indicates the column Code new ConfigContext (). init (). job. insert (dynamic T); new ConfigContext (). init (). job. insertOrUpdate (dynamic T); new ConfigContext (). init (). job. update (dynamic T) public class ConfigContext: Database <ConfigContext> {protected readon Ly string _ connectionString; protected IDbConnection _ connection; public IDbConnection Connection => _ connection ?? (_ Connection = GetOpenConncetion (); // Table name public Table <Site> Site {get; set;} public Table <Job> Job {get; set ;} public ConfigContext () {_ connectionString = System. configuration. configurationManager. connectionStrings ["Config_connectionString"]. connectionString;} public ConfigContext Init () {return Init (Connection as System. data. common. dbConnection, commandTimeout: 200);} public IDbConnection GetOpenConncetion () {var connection = new SQLiteConnection (_ connectionString); connection. open (); return connection ;}}