Exemplo n.º 1
0
 public IList<IStudent> GetStudentCollection()
 {
     var fakeData1 = new Student { DateOfBirth = DateTime.Now, FastName = "Olu", Gender = "F", LastName = "Gbile", Faculty = "science" };
     var fakeData2 = new Student { DateOfBirth = DateTime.Now, FastName = "shola", Gender = "F", LastName = "zombie", Faculty = "science" };
     var fakeData3 = new Student { DateOfBirth = DateTime.Now, FastName = "ade", Gender = "M", LastName = "Gbile", Faculty = "science" };
     var fakeData4 = new Student { DateOfBirth = DateTime.Now, FastName = "seun", Gender = "F", LastName = "adebayo", Faculty = "science" };
     var fakeData5 = new Student { DateOfBirth = DateTime.Now, FastName = "iyabo", Gender = "F", LastName = "oguunyode", Faculty = "science" };
     var fakeData6 = new Student { DateOfBirth = DateTime.Now, FastName = "folake", Gender = "F", LastName = "Gbile", Faculty = "science" };
     var fakeData7 = new Student { DateOfBirth = DateTime.Now, FastName = "semiu", Gender = "M", LastName = "kadiri", Faculty = "science" };
     var fakeData8 = new Student { DateOfBirth = DateTime.Now, FastName = "kayode", Gender = "M", LastName = "odeggami", Faculty = "science" };
     var fakeData9 = new Student { DateOfBirth = DateTime.Now, FastName = "oladapo", Gender = "M", LastName = "gbesko", Faculty = "science" };
     var studentCollection = new List<IStudent> { fakeData1, fakeData2, fakeData3, fakeData4, fakeData5, fakeData6, fakeData7, fakeData8, fakeData9 };
     return studentCollection;
 }
Exemplo n.º 2
0
        public IStudent MaptoIStudent(StudentDB student)
        {
            var newstudent = new Student
            {
                StudentId = student.studentId,
                MatricNumber = student.MatricNumber,
                DateOfBirth = DateTime.Parse(student.DateOfBirth.ToString()),
                DepartmentCode = student.DepartmentCode,
                Faculty = student.Faculty,
                FastName = student.FirstName,
                Gender = Convert.ToChar(student.Gender).ToString(),
                GraduationYear = student.GraduationYear,
                LastName = student.LastName,
                MiddleName = student.MiddleName,
                Nationality = student.Nationality,
                YearAdmitted = student.YearAdmitted
            };

            return newstudent;
        }