Esempio n. 1
0
        public List <Student> CreatePerson(Student student)                                                   // a. Create User
        {
            if (String.IsNullOrEmpty(student.Name) || student.Name.Length > 50 || student.AvailableSlots < 0) // Punto 6 practica 4
            {
                throw new Exception();
            }
            List <Database_Layer.Models.Student> studentDAO = DTOMappers.MapStudentsDAO(
                new List <Student>()
            {
                student
            }
                );

            studentDAO = _dbContext.AddStudents(studentDAO);
            return(DTOMappers.MapStudents(studentDAO));
        }