Ejemplo n.º 1
0
 private MySqlReaderScope(MySqlTable <TEntity> table, string fields, Action <MySqlDataReader, TEntity> loadAction)
 {
     if (string.IsNullOrWhiteSpace(fields))
     {
         fields = null;
     }
     _table      = table;
     _fields     = table._contextReadFields;
     _loadAction = table.ContentLoadAction;
     table._contextReadFields = fields;
     table.ContentLoadAction  = loadAction;
 }
Ejemplo n.º 2
0
 private MySqlReaderScope(MySqlTable <TEntity, TMySqlDataBase> table, string fields, Action <MySqlDataReader, TEntity> loadAction)
 {
     if (string.IsNullOrWhiteSpace(fields))
     {
         fields = null;
     }
     _table                  = table;
     _fields                 = table.DynamicReadFields;
     _loadAction             = table.DynamicLoadAction;
     table.DynamicReadFields = fields;
     table.DynamicLoadAction = loadAction;
 }
 /// <summary>
 /// 生成读取对象范围
 /// </summary>
 /// <param name="table">作用的表对象</param>
 /// <param name="name">表名</param>
 /// <returns>读取对象范围</returns>
 public static MySqlReadTableScope <TEntity> CreateScope(MySqlTable <TEntity> table, string name)
 {
     return(new MySqlReadTableScope <TEntity>(table, name));
 }
 private MySqlReadTableScope(MySqlTable <TEntity> table, string name)
 {
     _table   = table;
     _oldName = table.SetDynamicReadTable(name);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 生成修改读取字段范围
 /// </summary>
 /// <param name="table">作用的表对象</param>
 /// <param name="fields">字段</param>
 /// <param name="loadAction">读取方法</param>
 /// <returns>读取对象范围</returns>
 public static MySqlReaderScope <TEntity> CreateScope(MySqlTable <TEntity> table, string fields, Action <MySqlDataReader, TEntity> loadAction)
 {
     return(new MySqlReaderScope <TEntity>(table, fields, loadAction));
 }