public override List <T> Select <T>(Expression <Func <T, bool> > express) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); SelectOql cs = new SelectOql(); using (IDataReader idr = OracleSql.GetDtReader(cs.CreateSql <T>(express), oct)) { return(OracleResult.ValueToList <T>(idr)); } } }
public override int Insert <T>(T t) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new InsertOql(); using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(t), oct)) { return(OracleResult.SingleResult(ocm)); } } }
//根据主键查询 public override T Select <T>(object Value) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new SelectOql(); using (IDataReader reader = OracleSql.GetDtReader(ics.CreateSql <T>(Value), oct)) { return(OracleResult.ValueToModel <T>(reader)); } } }
public override object Select(string sql) { using (OracleConnection sct = new OracleConnection(Constring)) { sct.Open(); using (OracleCommand scmd = new OracleCommand(sql, sct)) { return(OracleResult.returnObject(scmd)); } } }
/// <summary> /// 无参 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public override List <T> Select <T>() { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new SelectOql(); using (IDataReader idr = OracleSql.GetDtReader(ics.CreateSql <T>(), oct)) { return(OracleResult.ValueToList <T>(idr)); } } }
public override int Delete <T>(Expression <Func <T, bool> > express) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new DeleteOql(); using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(express), oct)) { return(OracleResult.SingleResult(ocm)); } } }
public override int Delete <T>(List <T> t) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new DeleteOql(); using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(t), oct)) { return(OracleResult.ManyResult(ocm)); } } }
public override int Delete <T>(object Value) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new DeleteOql(); using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(Value), oct)) { return(OracleResult.SingleResult(ocm)); } } }
public override int Update(string sql) { using (OracleConnection oct = new OracleConnection(Constring)) { oct.Open(); ics = new UpdateOql(); using (OracleCommand ocm = new OracleCommand(sql, oct)) { return(OracleResult.SingleResult(ocm)); } } }