private void MapStructuralProperty(IStructuralTypeConfiguration type, PropertyInfo property, PropertyKind propertyKind, bool isCollection) { Contract.Assert(type != null); Contract.Assert(property != null); Contract.Assert(propertyKind == PropertyKind.Complex || propertyKind == PropertyKind.Primitive); if (!isCollection) { if (propertyKind == PropertyKind.Primitive) { type.AddProperty(property); } else { type.AddComplexProperty(property); } } else { if (_isQueryCompositionMode) { Contract.Assert(propertyKind != PropertyKind.Complex, "we don't create complex types in query composition mode."); } type.AddCollectionProperty(property); } }
private PrimitivePropertyConfiguration GetPrimitivePropertyConfiguration(Expression propertyExpression, bool optional = false) { PropertyInfo propertyInfo = PropertySelectorVisitor.GetSelectedProperty(propertyExpression); PrimitivePropertyConfiguration property = _configuration.AddProperty(propertyInfo); if (optional) { property.IsOptional(); } return(property); }
private void MapStructuralProperty(IStructuralTypeConfiguration type, PropertyInfo property, PropertyKind propertyKind, bool isCollection) { Contract.Assert(type != null); Contract.Assert(property != null); Contract.Assert(propertyKind == PropertyKind.Complex || propertyKind == PropertyKind.Primitive || propertyKind == PropertyKind.Collection); if (!isCollection) { if (propertyKind == PropertyKind.Primitive) { type.AddProperty(property); } else { type.AddComplexProperty(property); } } else { if (_isQueryCompositionMode) { Contract.Assert(propertyKind != PropertyKind.Complex, "we don't create complex types in query composition mode."); } type.AddCollectionProperty(property); } }