public async Task RemoveStudent(PublicUserData StudentPublicData, PublicUserData TutorPublicData) { Students = Common.RemoveFromList(Students, StudentPublicData); await this.SaveAsync(); Student student = await StudentPublicData.Student.FetchIfNeededAsync(); PrivateStudentData privateStudentData = student.PrivateStudentData; IDictionary <string, object> parameters = new Dictionary <string, object> { { "privateStudentDataId", privateStudentData.ObjectId }, { "tutorPublicDataId", TutorPublicData.ObjectId } }; await ParseCloud.CallFunctionAsync <string>("removeTutor", parameters); }
public async Task AcceptStudentRequest(PublicUserData StudentPublicData, PublicUserData TutorPublicData) { RequestsFromStudents = Common.RemoveFromList(RequestsFromStudents, StudentPublicData); IList <PublicUserData> students = Students; students.Add(StudentPublicData); Students = students; Student student = await StudentPublicData.Student.FetchIfNeededAsync(); PrivateStudentData privateStudentData = student.PrivateStudentData; IDictionary <string, object> parameters = new Dictionary <string, object> { { "privateStudentDataId", privateStudentData.ObjectId }, { "tutorPublicDataId", TutorPublicData.ObjectId } }; await ParseCloud.CallFunctionAsync <string>("addTutor", parameters); //this.AddUniqueToList("students", StudentPublicData); await this.SaveAsync(); }