internal void Construct(ApplicationCompositionDefinition composition, CompositeDataMap dataMap, DetailController detailController) { _composition = composition; _compositeDataMap = dataMap; _componentDataMaps = dataMap.Components(composition.To()); _detailController = detailController; }
public static void OnBeforeSave(CompositeDataMap dataMap) { ApplicationBehaviorDispatcher .OnBeforeSave(dataMap.Composite, dataMap.Application); foreach (var component in dataMap.Components()) { foreach (var componentDataMap in component.DataMaps) { ApplicationBehaviorDispatcher .OnBeforeSave(componentDataMap, component.Application); } } }
private static void SaveAsyncImpl(CompositeDataMap dataMap, SQLiteConnection connection) { connection.Execute("delete from DataMap where LocalId = ?", dataMap.Composite.LocalState.LocalId); connection.Insert(new PersistableDataMap(dataMap.Application, dataMap.Composite, true, DateTime.Now)); foreach (var component in dataMap.Components()) { foreach (var componentDataMap in component.DataMaps) { // Links the component to its composite. componentDataMap.LocalState.ParentId = dataMap.Composite.LocalState.LocalId; connection.Execute("delete from DataMap where LocalId = ?", componentDataMap.LocalState.LocalId); connection.Insert(new PersistableDataMap(component.Application, componentDataMap, true, DateTime.Now)); } } }