Beispiel #1
0
        /// <summary>
        ///     Call to publish tables
        /// </summary>
        internal void PublishTables(ISterlingDriver driver)
        {
            Driver = driver;

            lock (((ICollection)TableDefinitions).SyncRoot)
            {
                foreach (var table in RegisterTables())
                {
                    if (TableDefinitions.ContainsKey(table.TableType))
                    {
                        throw new SterlingDuplicateTypeException(table.TableType, Name);
                    }
                    TableDefinitions.Add(table.TableType, table);
                }
            }
            Driver.PublishTables(TableDefinitions);
        }
Beispiel #2
0
        /// <summary>
        ///     Call to publish tables
        /// </summary>
        internal void PublishTables(ISterlingDriver driver)
        {
            using (LockAsync().Result)
            {
                Driver = driver;

                foreach (var table in RegisterTables())
                {
                    if (TableDefinitions.ContainsKey(table.TableType))
                    {
                        throw new SterlingDuplicateTypeException(table.TableType, Name);
                    }

                    TableDefinitions.Add(table.TableType, table);
                }

                Driver.PublishTables(TableDefinitions, this.Database.TypeResolver.ResolveTableType);
            }
        }