protected async Task SaveLocation() { Db.PortDetails.Add(portForm.ToPortDetails()); await Db.SaveChangesAsync(); locations = await Db.Locations.ToArrayAsync(); portsGridView = locations .SelectMany(p => p.Ports) .Where(AreValidRecords) .Select(p => PortDetailsGridView.FromPort(p)) .ToArray(); portForm = new PortDetailsForm(); await EditorPanel.HideAsync(); await SuccessNotification.Show(); }
protected async Task SaveLocation() { Db.PortDetails.Add(portForm.ToPortDetails()); try { await Db.SaveChangesAsync(); } catch (System.Exception) { await FailNotification.Show(); } portsGridView = await LoadPortsViewModel(); portForm = new PortDetailsForm(); await EditorPanel.HideAsync(); await SuccessNotification.Show(); }