public async Task SaveFamilyAsync() { try { var savable = Model as Csla.Core.ISavable; Error = null; IsBusy = true; OnSaving(Model); var saved = (Family)await savable.SaveAsync(); var merger = new Csla.Core.GraphMerger(); merger.MergeBusinessListGraph <Family, Child>(Model, saved); IsBusy = false; OnSaved(); } catch (Exception ex) { IsBusy = false; Error = ex; OnSaved(); } }
public async Task SaveFamilyAsync() { var saved = await SaveAsync(); var merger = new Csla.Core.GraphMerger(); merger.MergeBusinessListGraph <Family, Child>(Model, saved); }
public async Task SaveFamilyAsync() { try { var savable = Model as Csla.Core.ISavable; Error = null; IsBusy = true; OnSaving(Model); var saved = (Family)await savable.SaveAsync(); var merger = new Csla.Core.GraphMerger(); merger.MergeBusinessListGraph <Family, Child>(Model, saved); // reset CurrentChild if (CurrentChild != null) { foreach (var item in Model) { var itemDetails = item.ChildDetails; var curDetails = CurrentChild.ChildDetails; if (itemDetails.GivenName == curDetails.GivenName && itemDetails.FamilyName == curDetails.FamilyName && itemDetails.Birthday == curDetails.Birthday) { CurrentChild = item; break; } } } IsBusy = false; OnSaved(); } catch (Exception ex) { IsBusy = false; Error = ex; Console.WriteLine("Error while saving family."); Console.WriteLine(ex); OnSaved(); } }