public string GetInsertSqlStatement <T>(string[] columns, bool isExclude = false) { try { var entity = MyContainer.Get(typeof(T)); var sql = MyEntityUtil.BuildInsertSqlStatement(entity, columns, isExclude); return(sql); } catch { throw new Exception("指定类型未在MyContainer中注册"); } }
public string GetUpdateSqlStatement <T>(string[] columns, bool isExclude = false, MySearchUtil util = null) { try { var entity = MyContainer.Get(typeof(T)); var sql = MyEntityUtil.BuildUpdateSqlStatement(entity, columns, isExclude, util == null ? "" : util.GetConditionClaus()); return(sql); } catch { throw new Exception("指定类型未在MyContainer中注册"); } }
public string GetInsertSqlStatement <T>(object obj) { try { var entity = MyContainer.Get(typeof(T)); var sql = MyEntityUtil.BuildInsertSqlByAnonymous(entity, obj); return(sql); } catch { throw new Exception("指定类型未在MyContainer中注册"); } }