Class PropertyBuilder<TEntity, TProperty>
Fluent builder for configuring entity properties.
public sealed class PropertyBuilder<TEntity, TProperty> where TEntity : class
Type Parameters
TEntityThe entity type.
TPropertyThe property type.
- Inheritance
-
PropertyBuilder<TEntity, TProperty>
- Inherited Members
Methods
HasMaxLength(int)
Sets the maximum length for string properties.
public PropertyBuilder<TEntity, TProperty> HasMaxLength(int maxLength)
Parameters
maxLengthintThe maximum length.
Returns
- PropertyBuilder<TEntity, TProperty>
The property builder for chaining.
HasPrecision(int, int?)
Sets the precision for numeric properties.
public PropertyBuilder<TEntity, TProperty> HasPrecision(int precision, int? scale = null)
Parameters
Returns
- PropertyBuilder<TEntity, TProperty>
The property builder for chaining.
IsComputed()
Marks the property as computed.
public PropertyBuilder<TEntity, TProperty> IsComputed()
Returns
- PropertyBuilder<TEntity, TProperty>
The property builder for chaining.
IsConcurrencyToken()
Marks the property as a concurrency token.
public PropertyBuilder<TEntity, TProperty> IsConcurrencyToken()
Returns
- PropertyBuilder<TEntity, TProperty>
The property builder for chaining.
IsRequired(bool)
Marks the property as required.
public PropertyBuilder<TEntity, TProperty> IsRequired(bool isRequired = true)
Parameters
isRequiredboolWhether the property is required.
Returns
- PropertyBuilder<TEntity, TProperty>
The property builder for chaining.