private void WriteFunctionImportEntityTypeMappingElement( FunctionImportEntityTypeMapping entityTypeMapping) { this._xmlWriter.WriteStartElement("EntityTypeMapping"); this._xmlWriter.WriteAttributeString("TypeName", MslXmlSchemaWriter.CreateFunctionImportEntityTypeMappingTypeName(entityTypeMapping)); this.WriteFunctionImportPropertyMappingElements(entityTypeMapping.PropertyMappings.Cast <FunctionImportReturnTypeScalarPropertyMapping>()); foreach (FunctionImportEntityTypeMappingCondition condition in entityTypeMapping.Conditions) { this.WriteFunctionImportConditionElement(condition); } this._xmlWriter.WriteEndElement(); }
public void CreateFunctionImportEntityTypeMappingTypeName_returns_correct_TypeName_attribute_value() { var ofEntityTypes = new[] { new EntityType("OfType1", "Ns", DataSpace.CSpace), new EntityType("OfType2", "Ns", DataSpace.CSpace) }; var entityTypes = new[] { new EntityType("ET1", "Ns", DataSpace.CSpace), new EntityType("ET2", "Ns", DataSpace.CSpace) }; var mapping = new FunctionImportEntityTypeMapping( ofEntityTypes, entityTypes, new Collection <FunctionImportReturnTypePropertyMapping>(), new List <FunctionImportEntityTypeMappingCondition>()); Assert.Equal( "Ns.ET1;Ns.ET2;IsTypeOf(Ns.OfType1);IsTypeOf(Ns.OfType2)", MslXmlSchemaWriter.CreateFunctionImportEntityTypeMappingTypeName(mapping)); }