Esempio n. 1
0
 private string QueryCondition <TCondition>(TCondition condition, ConditionRelationShip conditionRelationShip) =>
 $" where {string.Join($" {conditionRelationShip.ToString()} ", ObjectReader.GetPropertiesColumnValues(condition, false))}";
Esempio n. 2
0
 /// <inheritdoc cref="IQueryManipulate"/>
 /// <summary>
 /// create Update query for Update Data in the Table using multi condition and the relationships between them
 /// </summary>
 /// <typeparam name="TTable">Class Or Struct contains properties their
 /// Names are the same withe the Column Names; so the value of them will be updated in the DataBase</typeparam>
 /// <param name="tableColumns">Class Or Struct contains properties their
 /// Names are the same withe the Column Names; the properties type must be <see cref="ColumnValue{T}"/></param>
 /// <param name="condition">Class Or Struct contains properties their
 /// Names are the same withe the Column Names; the properties type must be <see cref="ColumnValue{T}"/></param>
 /// <param name="conditionRelationShip">the relation ship between conditions in the Query</param>
 public string UpDate <TTable>(TTable tableColumns, TTable condition,
                               ConditionRelationShip conditionRelationShip) =>
 $"{UpDate(tableColumns)}{QueryCondition(condition, conditionRelationShip)}";
Esempio n. 3
0
 /// <summary>
 /// make query for Read the Data From the DataBase by condition
 /// and the result will be table by the same columns that inputted
 /// and order the result depending on the <see cref="OrderBy"/> object
 /// </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="columns"> the columns that will be returned </param>
 /// <param name="orderBy">instance of <see cref="OrderBy "/> for order the result </param>
 /// <returns></returns>
 public string Read <TCondition>(TCondition condition, ConditionRelationShip conditionRelationShip,
                                 IEnumerable <SQLiteTableColumn> columns, OrderBy orderBy) =>
 $"{Read(columns)}{QueryCondition(condition, conditionRelationShip)}{orderBy}";
Esempio n. 4
0
 /// <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)}";
Esempio n. 5
0
 /// <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>
 /// <returns></returns>
 public string Read <TCondition>(TCondition condition, ConditionRelationShip conditionRelationShip,
                                 ref SQLiteTableColumn column) => $"{Read(ref column)}{QueryCondition(condition, conditionRelationShip)}";
Esempio n. 6
0
 /// <inheritdoc cref="IQueryReadData"/>
 /// <summary>
 /// make query for Read the Data From the DataBase by condition
 /// </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"></param>
 /// <returns></returns>
 public string Read <TCondition>(TCondition condition, ConditionRelationShip conditionRelationShip) =>
 $"{Read()}{QueryCondition(condition, conditionRelationShip)}";
Esempio n. 7
0
 /// <inheritdoc cref="IQueryManipulate"/>
 /// <summary>
 /// create delete query for delete Data in the Table using multi condition and the relationships between them
 /// </summary>
 /// <typeparam name="TTable">Class Or Struct contains properties their
 /// Names are the same withe the Column Names; so the value of them will be updated in the DataBase</typeparam>
 /// <param name="condition">Class Or Struct contains properties their
 ///     Names are the same withe the Column Names; the properties type must be <see cref="T:HBSQLite.ColumnValue`1" /></param>
 /// <param name="conditionRelationShip">the relation ship between conditions in the Query</param>
 public string Delete <TTable>(TTable condition, ConditionRelationShip conditionRelationShip) =>
 $"{Delete()}{QueryCondition(condition, conditionRelationShip)}";