private async void DeleteGroupButtonClick(object sender, RoutedEventArgs e)
        {
            if (GroupDataGrid.SelectedIndex == -1)
            {
                return;
            }

            await using var dbContext = new ApplicationContext();
            var selectedRow = GroupDataGrid.SelectedItem as IShortGroup ??
                              throw new ArgumentNullException(nameof(GroupDataGrid.SelectedItem));

            foreach (var model in await dbContext.Models
                     .Include(x => x.Group)
                     .Where(x => x.Group.Id == selectedRow.Id)
                     .ToArrayAsync())
            {
                model.Group = null;
            }

            dbContext.Groups.Remove(new Group
            {
                Id = selectedRow.Id
            });
            await dbContext.SaveChangesAsync();

            await Task.WhenAll(GroupDataGrid.ReloadGroupTableAsync(),
                               MainWindowProvider.Instance.Window.ModelsDataGrid.ReloadModelsTableAsync());
        }
 private async void FillTableWhenInizialized(object sender, EventArgs e)
 {
     await GroupDataGrid.ReloadGroupTableAsync();
 }