本文整理汇总了C#中RouteValueDictionary.ToExtendedRouteValueDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# RouteValueDictionary.ToExtendedRouteValueDictionary方法的具体用法?C# RouteValueDictionary.ToExtendedRouteValueDictionary怎么用?C# RouteValueDictionary.ToExtendedRouteValueDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteValueDictionary
的用法示例。
在下文中一共展示了RouteValueDictionary.ToExtendedRouteValueDictionary方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToExtendedRouteValueDictionarySerializesComplexTypes
public void ToExtendedRouteValueDictionarySerializesComplexTypes()
{
// Arrange
var model = CreateModel();
var routeValueDictionary = new RouteValueDictionary(model);
// Act
var extendedRouteValueDictionary = routeValueDictionary.ToExtendedRouteValueDictionary();
// Assert
Assert.Equal(model.FirstChild.Name, extendedRouteValueDictionary["FirstChild.Name"]);
Assert.Equal(model.FirstChild.Age, extendedRouteValueDictionary["FirstChild.Age"]);
Assert.Equal(model.FirstChild.Gender, extendedRouteValueDictionary["FirstChild.Gender"]);
}
开发者ID:ErikSchierboom,项目名称:aspnetmvcserialization,代码行数:14,代码来源:RouteValueDictionaryExtensionsTests.cs
示例2: ToExtendedRouteValueDictionarySerializesEnumerableOfPrimitiveType
public void ToExtendedRouteValueDictionarySerializesEnumerableOfPrimitiveType()
{
// Arrange
var model = CreateModel();
var routeValueDictionary = new RouteValueDictionary(model);
// Act
var extendedRouteValueDictionary = routeValueDictionary.ToExtendedRouteValueDictionary();
// Assert
Assert.Equal(model.ChildAges[0], extendedRouteValueDictionary["ChildAges[0]"]);
Assert.Equal(model.ChildAges[1], extendedRouteValueDictionary["ChildAges[1]"]);
Assert.False(extendedRouteValueDictionary.ContainsKey("ChildAges[2]"));
}
开发者ID:ErikSchierboom,项目名称:aspnetmvcserialization,代码行数:15,代码来源:RouteValueDictionaryExtensionsTests.cs
示例3: ToExtendedRouteValueDictionarySerializesDictionary
public void ToExtendedRouteValueDictionarySerializesDictionary()
{
// Arrange
var model = CreateModel();
var routeValueDictionary = new RouteValueDictionary(model);
// Act
var extendedRouteValueDictionary = routeValueDictionary.ToExtendedRouteValueDictionary();
// Assert
Assert.Equal(model.ChildNameAndAge.Keys.ElementAt(0), extendedRouteValueDictionary["ChildNameAndAge[0].Key"]);
Assert.Equal(model.ChildNameAndAge.Values.ElementAt(0), extendedRouteValueDictionary["ChildNameAndAge[0].Value"]);
Assert.Equal(model.ChildNameAndAge.Keys.ElementAt(1), extendedRouteValueDictionary["ChildNameAndAge[1].Key"]);
Assert.Equal(model.ChildNameAndAge.Values.ElementAt(1), extendedRouteValueDictionary["ChildNameAndAge[1].Value"]);
}
开发者ID:ErikSchierboom,项目名称:aspnetmvcserialization,代码行数:16,代码来源:RouteValueDictionaryExtensionsTests.cs
示例4: ToExtendedRouteValueDictionarySerializesEnumerableOfComplexType
public void ToExtendedRouteValueDictionarySerializesEnumerableOfComplexType()
{
// Arrange
var model = CreateModel();
var routeValueDictionary = new RouteValueDictionary(model);
// Act
var extendedRouteValueDictionary = routeValueDictionary.ToExtendedRouteValueDictionary();
// Assert
Assert.Equal(model.Children[0].Name, extendedRouteValueDictionary["Children[0].Name"]);
Assert.Equal(model.Children[0].Age, extendedRouteValueDictionary["Children[0].Age"]);
Assert.Equal(model.Children[1].Name, extendedRouteValueDictionary["Children[1].Name"]);
Assert.Equal(model.Children[1].Age, extendedRouteValueDictionary["Children[1].Age"]);
Assert.False(extendedRouteValueDictionary.ContainsKey("Children[2].Name"));
Assert.False(extendedRouteValueDictionary.ContainsKey("Children[2].Age"));
}
开发者ID:ErikSchierboom,项目名称:aspnetmvcserialization,代码行数:18,代码来源:RouteValueDictionaryExtensionsTests.cs
示例5: ToExtendedRouteValueDictionarySerializesPrimitiveTypes
public void ToExtendedRouteValueDictionarySerializesPrimitiveTypes()
{
// Arrange
var model = CreateModel();
var routeValueDictionary = new RouteValueDictionary(model);
// Act
var extendedRouteValueDictionary = routeValueDictionary.ToExtendedRouteValueDictionary();
// Assert
Assert.Equal(model.Name, extendedRouteValueDictionary["Name"]);
Assert.Equal(model.Age, extendedRouteValueDictionary["Age"]);
Assert.Equal(model.Gender, extendedRouteValueDictionary["Gender"]);
}
开发者ID:ErikSchierboom,项目名称:aspnetmvcserialization,代码行数:14,代码来源:RouteValueDictionaryExtensionsTests.cs