Class ViewBuilder<TEntity>
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Instances of this class are returned from methods when using the Microsoft.EntityFrameworkCore.ModelBuilder API and it is not designed to be directly constructed in your application code.
public class ViewBuilder<TEntity> : ViewBuilder, IInfrastructure<EntityTypeBuilder>, IInfrastructure<EntityTypeBuilder<TEntity>> where TEntity : class
Type Parameters
TEntity
The entity type being configured.
- Inheritance
-
ViewBuilder<TEntity>
- Implements
-
IInfrastructure<EntityTypeBuilder>IInfrastructure<EntityTypeBuilder<TEntity>>
- Inherited Members
Constructors
ViewBuilder(in StoreObjectIdentifier, EntityTypeBuilder<TEntity>)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public ViewBuilder(in StoreObjectIdentifier storeObject, EntityTypeBuilder<TEntity> entityTypeBuilder)
Parameters
storeObject
StoreObjectIdentifierentityTypeBuilder
EntityTypeBuilder<TEntity>
Methods
Property<TProperty>(Expression<Func<TEntity, TProperty>>)
Maps the property to a column on the current view and returns an object that can be used to provide view-specific configuration if the property is mapped to more than one view.
public virtual ViewColumnBuilder<TProperty> Property<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TEntity, TProperty>>A lambda expression representing the property to be configured (
blog => blog.Url
).
Returns
- ViewColumnBuilder<TProperty>
An object that can be used to configure the property.
Type Parameters
TProperty