public int GetStudentsNumber(Group group) { int number; using (StudentsBL studentsBl = new StudentsBL()) { number = studentsBl.GetList().Count(stud => stud.GroupNumber == group.GroupNumber); } return(number); }
static void Main(string[] args) { StudentsBL bl = new StudentsBL(); Console.WriteLine(bl.GetList().Count()); Student stud = new Student { FullName = "Test" }; bl.Add(stud); Console.WriteLine(bl.GetList().Count()); Console.ReadKey(); }