Beispiel #1
0
        private void CompileTableTypeInfo(CompilerInputTableTypeSelector tableTypeSelector)
        {
            var tableTypeInfoBuilder = this.m_outputBuilder.CreateTableTypeInfoBuilder(tableTypeSelector.FullName);
            var schema = this.m_store.GetTableTypeSchema(tableTypeSelector.FullName);
            var columnInfos = schema.Columns.OfType<DataColumn>().Select(dc => new DataColumnInfo(dc));

            tableTypeInfoBuilder.RegisterColumns(columnInfos);

            foreach (var dataRowContractMapping in tableTypeSelector.Mappings)
            {
                var contract = this.m_input.FindContractByInterfaceName(dataRowContractMapping.InterfaceName);
                //tableTypeInfoBuilder.RegisterMapping(contract, dataRowContractMapping);
            }

            tableTypeInfoBuilder.Accept();
        }
        internal CompilerInput(ICompilerInput other, int ordinal = 0)
        {
            this.Ordinal = ordinal;
            Debug.Assert(!ReferenceEquals(other, null), "other is null");
            if(!ReferenceEquals(other.Contracts, null))
            {
                foreach(var item in other.Contracts)
                {
                    if(!ReferenceEquals(item, null))
                    {
                        var clone = new  CompilerInputContract(item, this.Contracts.Count );
                        this.Contracts.Add( clone );
                    }
                }
            }
            if(!ReferenceEquals(other.TableTypes, null))
            {
                foreach(var item in other.TableTypes)
                {
                    if(!ReferenceEquals(item, null))
                    {
                        var clone = new  CompilerInputTableTypeSelector(item, this.TableTypes.Count );
                        this.TableTypes.Add( clone );
                    }
                }
            }
            if(!ReferenceEquals(other.QueryStoredProcedures, null))
            {
                foreach(var item in other.QueryStoredProcedures)
                {
                    if(!ReferenceEquals(item, null))
                    {
                        var clone = new  CompilerInputQueryStoredProcedureSelector(item, this.QueryStoredProcedures.Count );
                        this.QueryStoredProcedures.Add( clone );
                    }
                }
            }

            OnCreated();
        }