private Secretary GetGraduate(Enrollment enrollment)
        {
            var enrollments = new List<Enrollment> { enrollment };

            var ceremony = new GraduationCeremony(enrollments);
            var grads = ceremony.GetGraduates();

            return grads[0];
        }
Esempio n. 2
0
        private void Sample_ApplicationStartup()
        {
            var webMusicSchool = new HttpSchool("webMusicSchool", "localhost", "/dawn");
            webMusicSchool.Specializations.Add<Artist>(FileType.Audio, a => a.Id.ToString());

            var musicSchool = new LocalSchool("MusicSchool", @"C:\test\music");

            musicSchool.Specializations.Add<Artist>(FileType.Audio, a => a.Id.ToString());
            musicSchool.Specializations.Add<Artist>(a => @"temp\" + a.Id.ToString());

            var imageSchool = new LocalSchool("ImageSchool", @"C:\test\images");

            imageSchool.Specializations.Add<Artist>(FileType.Image, a => a.Id.ToString());
            imageSchool.Specializations.Add<User>(FileType.Image, u => u.Id.ToString());

            musicSchool.Enroll().SpecializingIn(FileType.Audio).For<Artist>();
            musicSchool.Enroll().For<Artist>();

            imageSchool.Enroll().SpecializingIn(FileType.Image).For<Artist>();
            imageSchool.Enroll().SpecializingIn(FileType.Image).For<User>();

            webMusicSchool.Enroll().SpecializingIn(FileType.Audio).For<Artist>();

            var ceremony = new GraduationCeremony(musicSchool.Enrollments);
            var grads = new List<Secretary>();

            grads.AddRange(ceremony.GetGraduates());

            ceremony = new GraduationCeremony(imageSchool.Enrollments);

            grads.AddRange(ceremony.GetGraduates());

            ceremony = new GraduationCeremony(webMusicSchool.Enrollments);

            grads.AddRange(ceremony.GetGraduates());

            Locate.InitializeWith(grads);
        }