src/Shared/EntityFramework/DbModelBuilder.cs
/// <summary>
/// Begins configuration of a lightweight convention that applies to all primitive
/// properties of the specified type in the model.
/// </summary>
/// <typeparam name="T"> The type of the properties that the convention will apply to. </typeparam>
/// <returns> A configuration object for the convention. </returns>
/// <remarks>
/// The convention will apply to both nullable and non-nullable properties of the
/// specified type.
/// </remarks>
Begins configuration of a lightweight convention that applies to all primitive
properties of the specified type in the model.
Begins configuration of a lightweight convention that applies to all primitive properties of the specified type in the model .
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
        public PropertyConventionConfiguration Properties<T>()
        {
            if (!typeof(T).IsValidEdmScalarType())
            {
                throw Error.ModelBuilder_PropertyFilterTypeMustBePrimitive(typeof(T));
            }
            var config = new PropertyConventionConfiguration(_conventionsConfiguration);
            return config.Where(
                p =>
                {
                    Type propertyType;
                    p.PropertyType.TryUnwrapNullableType(out propertyType);
                    return propertyType == typeof(T);
                });
        }
[ SuppressMessage ( " " , " " ) ] public PropertyConventionConfiguration Properties < T > ( ) { if ( ! typeof ( T ) . IsValidEdmScalarType ( ) ) { throw Error . ModelBuilder_PropertyFilterTypeMustBePrimitive ( typeof ( T ) ) ; } var config = new PropertyConventionConfiguration ( _conventionsConfiguration ) ; return config . Where ( p => { Type propertyType ; p . PropertyType . TryUnwrapNullableType ( out propertyType ) ; return propertyType == typeof ( T ) ; } ) ; }
Begins configuration of a lightweight convention that applies to all primitive
properties of the specified type in the model.
Begins configuration of a lightweight convention that applies to all primitive properties of the specified type in the model .
A configuration object for the convention.
A configuration object for the convention .
typeparam
The type of the properties that the convention will apply to.
The type of the properties that the convention will apply to .
remarks
The convention will apply to both nullable and non-nullable properties of the
specified type.
The convention will apply to both nullable and non - nullable properties of the specified type .