Esempio n. 1
0
        public LecturerDto GetLecturer(Guid lecturerUid)
        {
            var result = new LecturerDto();
            using (var dbContext = new AisDbContext())
            {
                var lecturer = dbContext.Lecturers.FirstOrDefault(g => g.u_Id == lecturerUid);
                if (lecturer != null)
                    result = Mapper.Map<LecturerDto>(lecturer);
            }

            return result;
        }
Esempio n. 2
0
        public void GetLecturerById()
        {
            using (var context = new AisDbContext())
            {
                var guid = new Guid("BE7296FB-924D-4746-B653-F44894C0283B");
                var lecturer = context.Lecturers.FirstOrDefault(l => l.u_Id == guid);

                Assert.IsNotNull(lecturer);
                Assert.IsNotNull(lecturer.LecturerAddresses);
                Assert.IsNotNull(lecturer.LecturerCommunityServices);
                Assert.IsNotNull(lecturer.LecturerCoordinators);
                Assert.IsNotNull(lecturer.LecturerEducationHistories);
                Assert.IsNotNull(lecturer.LecturerHonoraryDegrees);

            }
        }
Esempio n. 3
0
        public void GetLecturerData()
        {
            using (var context = new AisDbContext())
            {
                var lecturer = context.Lecturers.Include("LecturerAddress")
                    .Include("LecturerCommunityService")
                    .Include("LecturerCoordinator")
                    .Include("LecturerEducationHistory")
                    .Include("LecturerHonoraryDegree")
                    .FirstOrDefault();

                Assert.IsNotNull(lecturer);
                Assert.IsNotNull(lecturer.LecturerAddresses);
                Assert.IsNotNull(lecturer.LecturerCommunityServices);
                Assert.IsNotNull(lecturer.LecturerCoordinators);
                Assert.IsNotNull(lecturer.LecturerEducationHistories);
                Assert.IsNotNull(lecturer.LecturerHonoraryDegrees);

            }
        }