匿名对象集合
来源:互联网 发布:r语言绘制矩阵散点图 编辑:程序博客网 时间:2024/05/20 04:28
//匿名对象
var list = new List<object>();
list.Add(new {BranchName = "A01", Address = "人民路108号", Tel = "66666666"});
list.Add(new {BranchName = "A02", Address = "天津路888号", Tel = "88888888"});
var result = new { title = '分店地址' list = list};
//非匿名对象
class Branch
{
public string BranchName { get; set; }
public string Address { get; set; }
public string Tel { get; set; }
}
List<Branch> list = new List<Branch>();
list.Add(new Branch() {BranchName = "A01", Address = "人民路108号", Tel = "66666666"});
list.Add(new Branch() {BranchName = "A02", Address = "天津路888号", Tel = "88888888"});
var result = new { title = '分店地址' list = list};
var list = new List<object>();
list.Add(new {BranchName = "A01", Address = "人民路108号", Tel = "66666666"});
list.Add(new {BranchName = "A02", Address = "天津路888号", Tel = "88888888"});
var result = new { title = '分店地址' list = list};
//非匿名对象
class Branch
{
public string BranchName { get; set; }
public string Address { get; set; }
public string Tel { get; set; }
}
List<Branch> list = new List<Branch>();
list.Add(new Branch() {BranchName = "A01", Address = "人民路108号", Tel = "66666666"});
list.Add(new Branch() {BranchName = "A02", Address = "天津路888号", Tel = "88888888"});
var result = new { title = '分店地址' list = list};
0 0
- 匿名对象集合
- 对象,集合初始化器,匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 匿名对象
- 第52天
- 使用SQL语句对Oracle数据库数据进行拼接
- PHP中用$this传递对象
- 内部排序之三:堆排序
- 面向对象基础实验-Rectangle类
- 匿名对象集合
- 携程去哪儿合并可行性研究报告
- [乐意黎原创] eclipse打开当前文件所在文件夹的方法
- 1243567890
- Python tips: 什么是*args和**kwargs?
- PayPal全球活跃用户数已达一亿
- 谈谈今天的一次面试
- 立贴为证,规律作息时间
- Java下出现异常Unable to load library的解决思路