Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /// <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);
Exemplo n.º 3
0
 /// <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);
Exemplo n.º 4
0
 /// <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);