public async Task OnSaveClick() { Instructor.HireDate = DateTime.Parse($"{HireYear}/{HireMonth}/{HireDay}"); Instructor.Courses = new List <CourseAssignmentDto>(); foreach (var item in AssignedCourses.Where(c => c.Assigned)) { Instructor.Courses.Add(new CourseAssignmentDto { CourseID = item.CourseID, CourseTitle = item.Title }); } var created = await InstructorClient.Create(Instructor); UriHelper.NavigateTo("/instructors"); }
async Task LoadInstructor(string instructorId) { Instructor = await InstructorClient.GetDetails(instructorId); HireDay = Instructor.HireDate.Day; HireMonth = Instructor.HireDate.Month; HireYear = Instructor.HireDate.Year; LastDayInMonth = DateTime.DaysInMonth(HireYear, HireMonth); var instructorCourses = new HashSet <int>(Instructor.Courses.Select(c => c.CourseID)); AssignedCourses = new List <AssignedCourseData>(); foreach (var course in Courses) { AssignedCourses.Add(new AssignedCourseData { CourseID = course.Id, Title = course.Title, Assigned = instructorCourses.Contains(course.Id) }); } }
public InstructorClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(InstructorClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public InstructorClient(EndpointConfiguration endpointConfiguration) : base(InstructorClient.GetBindingForEndpoint(endpointConfiguration), InstructorClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public InstructorClient() : base(InstructorClient.GetDefaultBinding(), InstructorClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IInstructor.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(InstructorClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IInstructor)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(InstructorClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IInstructor)); }