/// <summary> /// initialize new instance of <see cref="SQLiteTableColumn"/> with one column /// </summary> /// <param name="column">the column that will be used for sorting</param> /// <param name="orderByWay">the way to oder</param> public OrderBy(SQLiteTableColumn column, OrderByWay orderByWay) { if (column == null) { throw new ArgumentNullException(nameof(column)); } Add(column); OrderByWay = orderByWay; }
/// <summary> /// initialize new instance of <see cref="SQLiteTableColumn"/> with order state /// </summary> /// <param name="orderByWay">the way to oder</param> public OrderBy(OrderByWay orderByWay) => OrderByWay = orderByWay;
/// <summary> /// make query for Read the Data From the DataBase by condition and the result will be one column /// </summary> /// <typeparam name="TCondition"> class or struct contain /// properties of type <see cref="ColumnValue{T}" /> /// the name of the properties as the names of the table columns</typeparam> /// <param name="condition">the object that will be used for making conditions</param> /// <param name="conditionRelationShip">the relationship between the parts of the condition</param> /// <param name="column"> the column that will be returned </param> /// <param name="orderByWay">instance of <see cref="OrderByWay"/> for order the result </param> /// <returns></returns> public string Read <TCondition>(TCondition condition, ConditionRelationShip conditionRelationShip, ref SQLiteTableColumn column, OrderByWay orderByWay) => $"{Read(ref column)}{QueryCondition(condition, conditionRelationShip)}{new OrderBy(column, orderByWay)}";
/// <summary> /// initialize new instance of <see cref="SQLiteTableColumn"/> with full data /// </summary> /// <param name="columns">the columns that will be used for sorting</param> /// <param name="orderByWay">the way to oder</param> public OrderBy(IEnumerable <SQLiteTableColumn> columns, OrderByWay orderByWay) { Columns = new List <SQLiteTableColumn>(columns); OrderByWay = orderByWay; }
/// <summary> /// make query for Read one column From the Table /// </summary> /// <param name="tableColumn">the column that will be returned </param> /// <param name="orderByWay"></param> /// <returns>query for Read All the Data From the Table</returns> public string Read(ref SQLiteTableColumn tableColumn, OrderByWay orderByWay) => $"{Read(ref tableColumn)}{new OrderBy(tableColumn, orderByWay)}";