/// <summary> /// Default constructor. /// </summary> internal PropertyMapping(EntityMapping entityMapping, PropertyDescriptor descriptor) { _options = PropertyMappingOptions.None; _databaseColumnName = descriptor.Name; this.EntityMapping = entityMapping; this.Descriptor = descriptor; }
/// <summary> /// Default constructor. /// </summary> internal PropertyMapping(EntityMapping entityMapping, int order, PropertyDescriptor descriptor) { _order = order; _options = PropertyMappingOptions.None; _databaseColumnName = descriptor.Name; this.EntityMapping = entityMapping; this.Descriptor = descriptor; }
/// <summary> /// Default constructor. /// </summary> public PropertyMapping(EntityMapping entityMapping, int order, PropertyMappingOptions options, PropertyDescriptor descriptor, string databaseColumn = null) { _order = order; _entityMapping = entityMapping; _options = options; _databaseColumnName = databaseColumn??descriptor.Name; this.Descriptor = descriptor; }
protected void SetPropertyInternal(string propertyName, PropertyMappingOptions options, string databaseColumnName) { var propDescriptor = TypeDescriptor.GetProperties(this.EntityType).OfType<PropertyDescriptor>().Single(propInfo => propInfo.Name == propertyName); this.SetPropertyInternal(propDescriptor, options, databaseColumnName); }
protected void SetPropertyInternal(PropertyDescriptor property, PropertyMappingOptions options, string databaseColumnName) { this.PropertyMappings[property.Name] = new PropertyMapping(this, this.PropertyMappings.Count, options, property, databaseColumnName); }