public List <Student> GetAllStudents() { List <Database_Layer.Models.Student> students = _dbContext.GetAll(); // creamos el DTOMappers para evitar las ambiguedades return(DTOMappers.MapStudents(students)); }
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)); }
public List <Student> GetAllStudents() { List <Database_Layer.Models.Student> students = _dbContext.GetAll(); return(DTOMappers.MapStudents(students)); }