本文整理汇总了C#中Params.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# Params.Merge方法的具体用法?C# Params.Merge怎么用?C# Params.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params.Merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(
JsonStoreData packet,
Params bioParams,
JsonStoreFilter filter,
JsonStoreSort sorter,
String selection,
Int32 timeout
) {
this.rqPacket = packet;
this._rq_bioParams = bioParams;
this._rq_filter = filter;
this._rq_sorter = sorter;
this._rq_selection = selection;
if (this.rqPacket == null)
this.rqPacket = this._creJSData();
XmlElement SQLtext = detectSQLTextElement(this.CursorIniDoc, this.bioCode);
_applyParamsTypes((XmlElement)SQLtext.ParentNode, this.rqBioParams);
this.InitCursorFields();
if (this.rqBioParams == null)
this._rq_bioParams = new Params();
base.Init(SQLtext.InnerText, this.rqBioParams);
String vSQL = this.preparedSQL;
Boolean v_filterIsDefined = this._applyFilter(this._rq_filter, ref this._rq_bioParams, ref vSQL);
Boolean v_sorterIsDefined = this._applySorter(this._rq_sorter, ref vSQL);
if (String.IsNullOrEmpty(this._rq_selection)) {
JsonStoreFilter vLocate = (this.rqPacket != null) ? this.rqPacket.Locate : null;
if (vLocate != null) {
// ищем запрошенную запись
var v_min_start = vLocate.FromPosition;
String vSQLStr = null;
var v_lprms = new Params();
vLocate.BuildSQLConditions(ref vSQLStr, v_lprms);
if (!String.IsNullOrEmpty(vSQLStr))
vSQLStr = vSQLStr + " AND";
v_lprms = v_lprms.Merge(this.rqBioParams, true);
v_lprms.SetValue("loc_start_from", v_min_start);
vSQLStr = String.Format(csLocateNextSQLTemplate, vSQL, vSQLStr);
int rnum = Convert.ToInt32(SQLCmd.ExecuteScalarSQL(this.Connection, vSQLStr, v_lprms, timeout));
if (this.rqPacket.Limit > 0)
this.rqPacket.Start = Math.Max(((rnum - 1) / this.rqPacket.Limit) * this.rqPacket.Limit, 0);
}
this._applyPagging(this.rqPacket, !v_filterIsDefined && !v_sorterIsDefined, ref this._rq_bioParams, ref vSQL, timeout);
} else {
this._buildSelectSelectionSQL(this._rq_selection, this.rqBioParams, ref vSQL);
}
this.preparedSQL = vSQL;
}
示例2: DoDelete
/*
/// <summary>
/// Удаляет запись по признаку первичного ключа.
/// </summary>
/// <exception cref="EBioException">Возбуждается, когда операция завершилась с ошибкой.</exception>
public void DoDelete(Params @params) {
this.doExecute(@params, "delete");
}
/// <summary>
/// Добавляет/Изменяет запись по признаку первичного ключа.
/// </summary>
/// <exception cref="EBioException">Возбуждается, когда операция завершилась с ошибкой.</exception>
public void DoInsertUpdate(Params @params) {
this.doExecute(@params, "insertupdate");
}
*/
private Params _buildPostParams(JsonStoreMetadata metadata, JsonStoreRow row, Params bioParams) {
Params v_rslt = new Params();
for (int i = 0; i < metadata.Fields.Count; i++)
v_rslt.Add(metadata.Fields[i].Name.ToLower(), row.Values[i]);
v_rslt = v_rslt.Merge(bioParams, false);
return v_rslt;
}
示例3: _applyFilter
private Boolean _applyFilter(JsonStoreFilter filter, ref Params bioParams, ref String vSQL) {
// фильтруем
String vCondition = null;
if (filter != null) {
var v_prms = new Params();
filter.BuildSQLConditions(ref vCondition, v_prms);
bioParams = v_prms.Merge(bioParams, true);
}
Boolean vFilterIsDefined = !String.IsNullOrEmpty(vCondition);
if (vFilterIsDefined) {
vSQL = String.Format(csFltrSQLTemplate, vSQL, vCondition);
return true;
}
return false;
}