本文整理汇总了C#中Command.WithParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Command.WithParameter方法的具体用法?C# Command.WithParameter怎么用?C# Command.WithParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command.WithParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessCommand
internal Command ProcessCommand(Command cmd)
{
foreach (var field in GetFields(GetType()))
{
var v = field.GetValue(this);
if (v == null)
continue;
cmd.WithParameter(Char.ToLowerInvariant(field.Name[0]) + field.Name.Substring(1), v.ToString());
}
return cmd;
}
示例2: PrepareRequestAndExecute
public static CommandResult PrepareRequestAndExecute(Command command, string privateKey, CommandResult.JsonPreparer<Command, CommandResult> baseExecutor)
{
var sb = new StringBuilder();
foreach (
var parameter in
command.Parameters)
if (String.CompareOrdinal(parameter.Key, @"userapp") != 0)
sb.Append(parameter.Value);
sb.Append(privateKey ?? "");
return baseExecutor(command.WithParameter("sum", StringUtils.Md5(sb.ToString())));
}
示例3: FillCommand
internal Command FillCommand(Command cmd)
{
var c =
cmd.WithParameter("sender", Sender)
.WithParameter("text", Text)
.WithParameter("sms_lifetime", (int) Lifetime)
.WithParameter("datetime", DateUtils.ToPochtaString(SendAt, ""));
if (Type != MessageType.Default)
c = c.WithParameter("type", (int)Type);
if (!String.IsNullOrEmpty(AlternativeSender))
c = c.WithParameter("asender", AlternativeSender);
if (!String.IsNullOrEmpty(UserApp))
c = c.WithParameter("userapp", UserApp);
return c;
}
示例4: Aggregate
private static Command Aggregate(Command query, string paramName, IEnumerable<string> values)
{
foreach (var value in values)
query = query.WithParameter(paramName, value);
return query;
}