public List <T> FindAll <T>() { MetaType metaType = MetaManager.GetMetaType(typeof(T)); Command = new Command(String.Format("select * from {0}", metaType.TableName)); return(List <T>()); }
public KQuery Union <T>(string where) { MetaType metaType = MetaManager.GetMetaType(typeof(T)); sql += String.Format(" union select * from {0} {1}", metaType.TableName, where); return(this); }
public KQuery Select <T>(string where) { entityType = typeof(T); MetaType metaType = MetaManager.GetMetaType(entityType); sql = String.Format("select * from {0} {1}", metaType.TableName, where); return(this); }
public object Scalar <T>(string propertyName, string where) { MetaType metaType = MetaManager.GetMetaType(typeof(T)); Command = new Command( String.Format("select {0} from {1} {2}", propertyName, metaType.TableName, where) ); return(Provider.QueryScalar(Command)); }
public T Get <T>(string where) { MetaType metaType = MetaManager.GetMetaType(typeof(T)); Command = new Command( String.Format("select * from {0} {1}", metaType.TableName, where) ); return(Get <T>()); }
public int Count <T>(string where) { MetaType metaType = MetaManager.GetMetaType(typeof(T)); Command = new Command( String.Format("select count(*) from {0} {1}", metaType.TableName, where) ); object result = Provider.QueryScalar(Command); int count = 0; int.TryParse(result.ToString(), out count); return(count); }