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(); } }
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(); } }
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(); } }