public override void UpdateDatabaseAfterUpdateSchema() { base.UpdateDatabaseAfterUpdateSchema(); DomainObject1 do1 = Session.FindObject<DomainObject1>(new BinaryOperator("Property1", "StartupObject")); if (do1 == null) { do1 = new DomainObject1(Session); do1.Property1 = "StartupObject"; do1.Save(); } }
public override void UpdateDatabaseAfterUpdateSchema() { base.UpdateDatabaseAfterUpdateSchema(); DomainObject1 do1 = Session.FindObject <DomainObject1>(new BinaryOperator("Property1", "StartupObject")); if (do1 == null) { do1 = new DomainObject1(Session); do1.Property1 = "StartupObject"; do1.Save(); } }
void showNavigationItemController_CustomShowNavigationItem(object sender, CustomShowNavigationItemEventArgs e) { showNavigationItemController.CustomShowNavigationItem -= new EventHandler <CustomShowNavigationItemEventArgs>(showNavigationItemController_CustomShowNavigationItem); ObjectSpace os = Application.CreateObjectSpace(); DomainObject1 do1 = os.FindObject <DomainObject1>(new BinaryOperator("Property1", "StartupObject")); if (do1 == null) { do1 = os.CreateObject <DomainObject1>(); } DetailView view = Application.CreateDetailView(os, do1); e.ActionArguments.ShowViewParameters.CreatedView = view; e.ActionArguments.ShowViewParameters.TargetWindow = TargetWindow.Current; e.Handled = true; }