private PropertyInfo GetProperty(Type type, ColumnValue columnValue) { var propertyInfo = _conventionReader.GetPropertyForColumn(columnValue.ColumnName, type); if (propertyInfo == null) { throw MissingPropertyException.CreateFromColumnName(type, columnValue.ColumnName); } return(propertyInfo); }
/// <summary> /// Reflects instance property. /// </summary> /// <param name="propertyName">Name of property.</param> /// <param name="nonPublic"><see langword="true"/> to reflect non-public property.</param> /// <returns>Instance property.</returns> /// <exception cref="MissingPropertyException">Property doesn't exist.</exception> public static Property <T, V> Require(string propertyName, bool nonPublic = false) => Get(propertyName, nonPublic) ?? throw MissingPropertyException.Create <T, V>(propertyName);
/// <summary> /// Reflects instance indexer property. /// </summary> /// <param name="propertyName">The name of the indexer property.</param> /// <param name="nonPublic"><see langword="true"/> to reflect non-public property.</param> /// <returns>The reflected indexer property.</returns> /// <exception cref="MissingPropertyException">The property doesn't exist.</exception> public static Indexer <T, A, V> Require(string propertyName = DefaultIndexerName, bool nonPublic = false) => Get(propertyName, nonPublic) ?? throw MissingPropertyException.Create <T, V>(propertyName);
/// <summary> /// Reflects static indexer property. /// </summary> /// <param name="propertyName">The name of the indexer property.</param> /// <param name="nonPublic"><see langword="true"/> to reflect non-public property.</param> /// <returns>The reflected indexer property.</returns> /// <exception cref="MissingPropertyException">The property doesn't exist.</exception> public static Reflection.Indexer <A, V> RequireStatic(string propertyName, bool nonPublic = false) => GetStatic(propertyName, nonPublic) ?? throw MissingPropertyException.Create <T, V>(propertyName);