/// <summary> /// Adds a Primitive Property to <paramref name="metadata"/> /// </summary> /// <param name="metadata">Metadata document to be added to</param> /// <param name="type">The type of the primitive property</param> /// <param name="property">Property to add</param> /// <param name="structuredType">Structured type to add property to</param> private static void AddPrimitiveProperty(ConstructableMetadata metadata, Type type, EdmProperty property, IEdmStructuredType structuredType) { if (property.DeclaringType is EntityType && ((EntityType)property.DeclaringType).KeyMembers.Contains(property.Name)) { metadata.AddKeyProperty(structuredType, property.Name, type, IsETagProperty(property)); } else if (type == typeof(Stream)) { metadata.AddNamedStreamProperty(structuredType, property.Name); } else { metadata.AddPrimitiveProperty(structuredType, property.Name, type, IsETagProperty(property)); } }