我有疑问可能是listize class with list to url string,之后传递给MVC控制器动作还有一些额外的参数,如public ActionResult Index(int? SomeId, Class Class)
?
public class Class
{
public int Id { get; set; }
public List<Item> Items { get; set; }
}
public class Item
{
public int Id { get; set; }
public string Name { get; set; }
}
将此类序列化为url:
var classToSerialize = new Class()
{
Id = 1,
Items = new List<Item>()
{
new Item() { Id = 1, Name = "Name1"},
new Item() {Id = 2, Name = "Name2"}
}
};
网址必须如何?