public StudentAddress UpdateStudentAddress(UpdateStudentAddressRequest request) { StudentAddress address = null; if (request != null && request.StudentAddress != null) { var dataAccess = new StudentAddressDataAccess(request.Context); address = dataAccess.Update(request.StudentAddress); } return(address); }
public List <StudentAddress> GetAllStudentAddresses(GetAllStudentAddressesRequest request) { List <StudentAddress> addresses = null; if (request != null) { var dataAccess = new StudentAddressDataAccess(request.Context); var studentAddresses = dataAccess.GetAll(); addresses = studentAddresses.ToList(); } return(addresses); }
public StudentAddress GetStudentAddressById(GetStudentAddressByIdRequest request) { StudentAddress address = null; if (request != null) { var dataAccess = new StudentAddressDataAccess(request.Context); var studentAddressQuery = dataAccess.GetById(request.IdStudentAddress); studentAddressQuery = studentAddressQuery.Include(a => a.Student); address = studentAddressQuery.FirstOrDefault(); } return(address); }