随笔 - 19  文章 - 0  评论 - 82  阅读 - 14970
  2012年8月13日
摘要: View Code public class Post { public int ID { get; set; } public User author { get; set; } public DateTime post_date { get; set; } public DateTime post_date_gmt { get; set; } public string post_content { get; set; } public string post_title { get; set; }... 阅读全文
posted @ 2012-08-13 23:47 蔚蓝海 阅读(227) 评论(0) 推荐(0) 编辑
摘要: List<T>转Jsonpublic static string Obj2Json<T>(T data){try{System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(data.GetType());using (MemoryStream ms = new MemoryStream()){serializer.WriteObject(ms, data 阅读全文
posted @ 2012-08-13 15:49 蔚蓝海 阅读(379) 评论(2) 推荐(0) 编辑
摘要: 这个用 EF很容易获取的 首先 cat 与 cat_a 一对多 cat_a 与 cat_b 一对多 cat_b 与post 多对一所以你要在 这些实体类里 加上对应的关系 比如 public class cat{id, name,value,virtual ICollection<cat_a> catalist }public class cat_a{id,catid,cattype,virtual cat_a }cat.where(x=>x.value=="catvalue")Include(x => x. cat_a.Select(s=>s 阅读全文
posted @ 2012-08-13 14:35 蔚蓝海 阅读(193) 评论(0) 推荐(0) 编辑
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示