本文整理汇总了C#中System.Web.Mvc.ControllerContext.GetPartName方法的典型用法代码示例。如果您正苦于以下问题:C# ControllerContext.GetPartName方法的具体用法?C# ControllerContext.GetPartName怎么用?C# ControllerContext.GetPartName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.ControllerContext
的用法示例。
在下文中一共展示了ControllerContext.GetPartName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindModel
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var systemName = controllerContext.GetAgentSystemName();
var metadata = _resolvers.GetAgentMetadata(systemName);
var partName = controllerContext.GetPartName();
var descriptiveName = controllerContext.GetRouteValue<string>("descriptiveName");
IPartCollection partCollection;
if (string.IsNullOrEmpty(partName))
{
partCollection = metadata.GetPartCollectionByDescriptiveName(descriptiveName);
}
else
{
partCollection = metadata.GetPartCollectionContainingPartName(partName);
}
if (partCollection == null)
{
throw new PartCollectionNotFoundException();
}
return partCollection;
}
示例2: BindModel
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var commandName = controllerContext.GetPartName();
var valueProvider = bindingContext.ValueProvider;
return _composite.GetInputModelFromCommandName(commandName, valueProvider, controllerContext.HttpContext.Request.Files);
}
示例3: BindModel
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var systemName = controllerContext.GetAgentSystemName();
var partName = controllerContext.GetPartName();
var metadata = _resolvers.GetAgentMetadata(systemName);
var agentPartMetadata = metadata.GetPartByTypeName(partName);
if (agentPartMetadata == null)
{
throw new TypeMetadataNotFoundException();
}
return agentPartMetadata;
}