/// <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; }
/// <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; }