コード例 #1
0
ファイル: DataRecordInfo.cs プロジェクト: dox0/DotNet471RS3
        /// <summary>
        /// Construct FieldMetadata for structuralType.Members from TypeUsage
        /// </summary>
        internal DataRecordInfo(TypeUsage metadata)
        {
            Debug.Assert(null != metadata, "invalid attempt to instantiate DataRecordInfo with null metadata information");

            IBaseList <EdmMember> structuralMembers = TypeHelpers.GetAllStructuralMembers(metadata);

            FieldMetadata[] fieldList = new FieldMetadata[structuralMembers.Count];
            for (int i = 0; i < fieldList.Length; ++i)
            {
                EdmMember member = structuralMembers[i];
                Debug.Assert((BuiltInTypeKind.EdmProperty == member.BuiltInTypeKind) ||
                             (BuiltInTypeKind.AssociationEndMember == member.BuiltInTypeKind),
                             "unexpected BuiltInTypeKind for member");
                fieldList[i] = new FieldMetadata(i, member);
            }
            _fieldMetadata = new System.Collections.ObjectModel.ReadOnlyCollection <FieldMetadata>(fieldList);
            _metadata      = metadata;
        }
コード例 #2
0
ファイル: DataRecordInfo.cs プロジェクト: uQr/referencesource
        /// <summary>
        /// Construct FieldMetadata for structuralType.Members from TypeUsage
        /// </summary>
        internal DataRecordInfo(TypeUsage metadata)
        {
            Debug.Assert(null != metadata, "invalid attempt to instantiate DataRecordInfo with null metadata information");

            IBaseList<EdmMember> structuralMembers = TypeHelpers.GetAllStructuralMembers(metadata);
            FieldMetadata[] fieldList = new FieldMetadata[structuralMembers.Count];
            for (int i = 0; i < fieldList.Length; ++i)
            {
                EdmMember member = structuralMembers[i];
                Debug.Assert((BuiltInTypeKind.EdmProperty == member.BuiltInTypeKind) ||
                             (BuiltInTypeKind.AssociationEndMember == member.BuiltInTypeKind),
                             "unexpected BuiltInTypeKind for member");
                fieldList[i] = new FieldMetadata(i, member);
            }
            _fieldMetadata = new System.Collections.ObjectModel.ReadOnlyCollection<FieldMetadata>(fieldList);
            _metadata = metadata;

        }