Exemplo n.º 1
0
 protected void ExecuteReader <K>(IList <T> entity) where K : DataEntity, new ()
 {
     try
     {
         IDbCommand com = InitiCommand();
         using (var read = com.ExecuteReader(CommandBehavior.CloseConnection))
         {
             var rs = ReaderDataEntity.CreaterReaderDataEntity <T, K>(this._entity, read, this._mapper);
             rs.FullDataEntity <T>(entity, read);
         }
     }
     finally
     {
         this._conn.Close();
     }
 }
Exemplo n.º 2
0
 public void Execute <K>(IList <T> entitys, IDBbatBuilder commandText, object paramObj = null) where K : DataEntity, new()
 {
     try
     {
         IDbCommand com = InitiCommand(commandText, paramObj);
         using (var read = com.ExecuteReader(CommandBehavior.CloseConnection))
         {
             var rs = ReaderDataEntity.CreaterReaderDataEntity <T, K>(this._entity, read, this._mapper);
             rs.FullDataEntity <T>(entitys, read);
         }
     }
     finally
     {
         this._conn.Close();
     }
 }
Exemplo n.º 3
0
        public void Execute <K>(IList <T> entitys, string commandText, object paramObj = null) where K : DataEntity, new()
        {
            try
            {
                var com = this._conn.GetIDbCommand(this._mapper.ServiceKey);
                com.CommandText = commandText;
                DBbatBuilder <T> .SetCommandParameter(commandText, com.Parameters, this.CreaterParamger, paramObj);

                using (var read = com.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    var rs = ReaderDataEntity.CreaterReaderDataEntity <T, K>(this._entity, read, this._mapper);
                    rs.FullDataEntity <T>(entitys, read);
                }
            }
            finally
            {
                this._conn.Close();
            }
        }