public async Task<Person> CreatePerson(string firstName, string surname, DateTime dob, string email, string mobile)
        {
            var person = new Person(
                firstName: firstName,
                surname: surname,
                dob: dob,
                email: email,
                mobile: mobile
                );

            var context = new DataAccess.Models.CourseFantasticDbContext();
            var dbPerson = new DataAccess.Models.Person()
            {
                FirstName = person.FirstName,
                Surname = person.Surname,
                DoB = person.Dob,
                Email = person.Email
            };
            context.People.Add(dbPerson);
            await context.SaveChangesAsync();

            person = await _repoPerson.Add(person);

            dbPerson.Identity = person.Identity;
            context.SaveChangesAsync();

            return person;
        }
예제 #2
0
        public Student(Person person, string studentID)
        {
            Person = person;
            StudentID = studentID;
            _attendance = new Dictionary<string, List<Attendance>>();

        }
예제 #3
0
		public Teacher(Person person, string employeeId, List<InstructorAssignment> subjects, List<InstructorAssignment> subjectAssignments) :this(person, employeeId, subjectAssignments)
		{
		    Assignments = subjects;
		}
예제 #4
0
 public Teacher(Person person, string employeeId, List<InstructorAssignment> subjectAssignments)
 {
     Person = person;
     EmployeeId = employeeId;
     Assignments = subjectAssignments;
 }
예제 #5
0
		public Timetable(Person person, List<TimeTableItem> items)
		{
		    Person = person;
		    Items = items;
		}