Example #1
0
        public async Task <DataMap> NewAsync(ApplicationSchemaDefinition application, CompositeDataMap dataMap = null)
        {
            var newDataMap = new DataMap(application);

            // If we have no composite data map it means
            // a "parent" data map is being created. For
            // the sake of coherence, let's simply wrap
            // it inside a CompositeDataMap structure.
            if (null == dataMap)
            {
                dataMap = CompositeDataMap.Wrap(application, newDataMap);
            }
            else
            {
                // A component data map is being created.
                // Let's link it to the composite root.
                newDataMap.LocalState.ParentId = dataMap.Composite.LocalState.LocalId;
            }

            await Task
            .Factory
            .StartNew(() => Dispatcher.OnNew(newDataMap, application, dataMap));

            return(newDataMap);
        }
Example #2
0
 public Task SaveAsync(ApplicationSchemaDefinition application, DataMap dataMap, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(SaveAsync(CompositeDataMap.Wrap(application, dataMap), cancellationToken));
 }