本文整理汇总了C#中Bar.EachEmployee方法的典型用法代码示例。如果您正苦于以下问题:C# Bar.EachEmployee方法的具体用法?C# Bar.EachEmployee怎么用?C# Bar.EachEmployee使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bar
的用法示例。
在下文中一共展示了Bar.EachEmployee方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main() {
IEnumerator<Bar.IEmployee> _it90 = null;
Bar.IEmployee person = default(Bar.IEmployee);
// item 19
Bar db = new Bar();
// item 35
Equal(null, db.GetEmployee(400));
// item 108
Equal(0, db.EmployeeCount());
// item 76
Bar.IEmployee john = db.InsertEmployee(400);
// item 77
Equal(400, john.Id);
// item 78
Equal(john, db.GetEmployee(400));
// item 75
Bar.IEmployee mark = db.InsertEmployee(0);
// item 83
NotEqual(mark, john);
NotEqual(mark.Id, john.Id);
// item 69
Equal(null, john.Name);
Equal(null, mark.Name);
// item 67
john.Name = "John";
john.Type = 100;
// item 68
mark.Name = "Mark";
mark.Type = 200;
// item 113
Equal("John", john.Name);
Equal(100, john.Type);
Equal("Mark", mark.Name);
Equal(200, mark.Type);
// item 92
List<string> names = new List<string>();
// item 900001
_it90 = ((IEnumerable<Bar.IEmployee>)db.EachEmployee()).GetEnumerator();
while (true) {
// item 900002
if (_it90.MoveNext()) {
} else {
break;
}
// item 900004
person = _it90.Current;
// item 93
names.Add(person.Name);
}
// item 95
names.Sort();
// item 114
Equal(new string[] { "John", "Mark" }, names);
// item 102
Equal(2, db.EmployeeCount());
// item 99
int johnId = john.Id;
int markId = mark.Id;
// item 100
db.DeleteEmployee(john);
db.DeleteEmployee(mark);
// item 101
Equal(null, db.GetEmployee(johnId));
Equal(null, db.GetEmployee(markId));
// item 115
Equal(0, db.EmployeeCount());
}