摘要: 1. 数据准备 Employee类如下:(构造数据时,特意把奇数ID的Employee设置成没有Department) public class Employee { public int ID { get; set; } public string Name { get; set; } publi 阅读全文
posted @ 2022-08-24 17:18 katesharing 阅读(49) 评论(0) 推荐(0)
摘要: 1. 数据准备 using System.Collections.Generic; namespace LINQTutorial { public class Employee { public int ID { get; set; } public string Name { get; set; 阅读全文
posted @ 2022-08-24 16:37 katesharing 阅读(1797) 评论(0) 推荐(0)
摘要: 官方解释 上面解释:1)TryGetValue是根据key返回相应的数据到value,如果没有key则返回默认值到value; 2)这个方法的返回是bool值,如果dictionary里有存在相应的key为true,没有存在,则为false 例子1 using System; using Syste 阅读全文
posted @ 2022-08-24 11:57 katesharing 阅读(11785) 评论(0) 推荐(2)