本文整理汇总了C#中Func.MustNotBeNull方法的典型用法代码示例。如果您正苦于以下问题:C# Func.MustNotBeNull方法的具体用法?C# Func.MustNotBeNull怎么用?C# Func.MustNotBeNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Func
的用法示例。
在下文中一共展示了Func.MustNotBeNull方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DefaultBuilder
public IConfigureConventions DefaultBuilder(Func<ModelInfo, HtmlTag> action)
{
action.MustNotBeNull();
var lambda = new LambdaConventions(LambdaConventions.AppliesAlways);
lambda.Builder = action;
_defaultBuilder = lambda;
return this;
}
示例2: Build
public IConfigureRoutingConventions Build(Func<RouteBuilderInfo, IEnumerable<Route>> builder)
#endif
{
builder.MustNotBeNull();
_lambda.Builder = builder;
_parent.Add((IBuildRoutes)_lambda);
return _parent;
}
示例3: WriteColumnsNames
public static void WriteColumnsNames(ICollection<string> columns, StringBuilder builder, Func<string, string> formatter)
{
columns.MustNotBeNull();
formatter.MustNotBeNull();
foreach (var column in columns)
{
builder.Append(formatter(column.Trim())).Append(",");
}
builder.RemoveLast();
}
示例4: SmartContextFacade
public SmartContextFacade(Controller ctrl,Func<dynamic> modelIdentifier,Type validationFailedPolicy,IValidationFailedPolicyFactory factory)
{
ctrl.MustNotBeNull();
modelIdentifier.MustNotBeNull();
validationFailedPolicy.MustNotBeNull();
factory.MustNotBeNull();
_ctrl = ctrl;
_modelIdentifier = modelIdentifier;
_validationFailedPolicy = validationFailedPolicy;
IsPost = ctrl.HttpContext.Request.IsPost();
_factory = factory;
}
示例5: PublishAfterStoring
/// <summary>
/// Stores the events using the specified action then publish them.
/// If persisting throws a <see cref="DuplicateOperationException"/> it will use those events for publishing
/// </summary>
/// <param name="bus"></param>
/// <param name="persistAction">Should throw <see cref="DuplicateOperationException"/> if a commit is duplicate</param>
public static void PublishAfterStoring(this IDispatchMessages bus,Func<IEvent[]> persistAction)
{
persistAction.MustNotBeNull();
IEvent[] events = Array.Empty<IEvent>();
try
{
events=persistAction();
}
catch (DuplicateOperationException ex)
{
events = ex.Events;
}
bus.Publish(events);
}
示例6: MethodToExecute
public IConfigureMakeSharp MethodToExecute(Func<MethodInfo, bool> matchMethod)
{
matchMethod.MustNotBeNull();
_matchMethod = matchMethod;
return this;
}
示例7: TasksAre
public IConfigureMakeSharp TasksAre(Func<Type, bool> matchType)
{
matchType.MustNotBeNull();
_matchType = matchType;
return this;
}
示例8: WriteColumnsNames
public static void WriteColumnsNames(string columns, StringBuilder builder, Func<string, string> formatter)
{
columns.MustNotBeEmpty();
formatter.MustNotBeNull();
WriteColumnsNames(columns.Split(','), builder, formatter);
}