示例#1
0
        public async Task Add()
        {
            await FacultyService.AddAsync(Current).ConfigureAwait(false);

            Collection = await FacultyService.GetAsync().ConfigureAwait(false);

            StateHasChanged();
        }
示例#2
0
 public async Task Update()
 {
     if (Collection is List <Faculty> facultyList)
     {
         facultyList[facultyList.FindIndex(r => r.Id == Current.Id)] = Current;
     }
     else
     {
         Collection = await FacultyService.GetAsync().ConfigureAwait(false);
     }
     StateHasChanged();
     Current = await FacultyService.UpdateAsync(Current).ConfigureAwait(false);
 }
示例#3
0
        public async Task ShowModal(int id)
        {
            Current = await PulpitService.GetAsync(id).ConfigureAwait(false);

            Current.Faculties = await FacultyService.GetAsync();
        }
示例#4
0
 public async Task ShowModal()
 {
     Current = new Pulpit {
         Faculties = await FacultyService.GetAsync()
     };
 }
示例#5
0
 protected override async Task OnInitAsync()
 {
     Collection = await FacultyService.GetAsync().ConfigureAwait(false);
 }