public static MachineRegistriesCollection Where(WhereDelegate <MachineRegistriesColumns> where, OrderBy <MachineRegistriesColumns> orderBy = null, Database database = null) { database = database ?? Db.For <MachineRegistries>(); var results = new MachineRegistriesCollection(database, database.GetQuery <MachineRegistriesColumns, MachineRegistries>(where, orderBy), true); return(results); }
private static MachineRegistries OneOrThrow(MachineRegistriesCollection c) { if (c.Count == 1) { return(c[0]); } else if (c.Count > 1) { throw new MultipleEntriesFoundException(); } return(null); }
/// <summary> /// Return every record in the MachineRegistries table. /// </summary> /// <param name="database"> /// The database to load from or null /// </param> public static MachineRegistriesCollection LoadAll(Database database = null) { Database db = database ?? Db.For <MachineRegistries>(); SqlStringBuilder sql = db.GetSqlStringBuilder(); sql.Select <MachineRegistries>(); var results = new MachineRegistriesCollection(db, sql.GetDataTable(db)) { Database = db }; return(results); }
/// <summary> /// This method is intended to respond to client side Qi queries. /// Use of this method from .Net should be avoided in favor of /// one of the methods that take a delegate of type /// WhereDelegate<MachineRegistriesColumns>. /// </summary> /// <param name="where"></param> /// <param name="database"></param> public static MachineRegistriesCollection Where(QiQuery where, Database database = null) { var results = new MachineRegistriesCollection(database, Select <MachineRegistriesColumns> .From <MachineRegistries>().Where(where, database)); return(results); }