public DbTableInfo Register <TModel>(string tableName = null, string token = null)
        {
            var type = typeof(TModel);

            if (string.IsNullOrEmpty(tableName))
            {
                tableName = type.Name;
            }

            var table = GetTable <TModel>();

            if (table != null)
            {
                throw new Exception("Model has existed");
            }

            table = new DbTableInfo(type, tableName);
            tableList.Add(table);

            return(table);
        }
 public InsertProvider<T> Insert<T>(DbTableInfo tableInfo)
 {
     return new InsertProvider<T>(tableInfo, sqlCache);
 } 
 public string GetInsert<T>(DbTableInfo tableInfo, string fields = null)
 {
     return Insert<T>(tableInfo).Fields(fields).GetSQL();
 }
 public UpdateProvider<T> Update<T>(DbTableInfo tableInfo)
 {
     return new UpdateProvider<T>(tableInfo,sqlCache);
 }
 public string GetUpdate<T>(DbTableInfo tableInfo, string fields = null, string where = null)
 {
     return Update<T>(tableInfo).Fields(fields).Where(where).GetSQL();
 }
 public DeleteProvider<T> Delete<T>(DbTableInfo tableInfo)
 {
     return new DeleteProvider<T>(tableInfo, sqlCache);
 }
 public string GetDelete<T>(DbTableInfo tableInfo, string where = null)
 {
     return Delete<T>(tableInfo).Where(where).GetSQL();
 }
 public SelectProvider<T> Select<T>(DbTableInfo tableInfo)
 {
     return new SelectProvider<T>(tableInfo, sqlCache);
 }