Class ScaffoldInterceptors
Base class for scaffold customizations. Constains virtual methods with no-op implementation for each customization point.
public abstract class ScaffoldInterceptors
- Inheritance
-
ScaffoldInterceptors
- Extension Methods
Methods
AfterSourceCodeGenerated(FinalDataModel)
Event, triggered after source code generation done. Provides access to database model objects with final types and names set. Could be used to establish link between database object and generated code.
public virtual void AfterSourceCodeGenerated(FinalDataModel model)
Parameters
model
FinalDataModelDatabase model descriptors.
GetAggregateFunctions(IEnumerable<AggregateFunction>)
Using this method you can add, remove or modify aggregate function schema information.
public virtual IEnumerable<AggregateFunction> GetAggregateFunctions(IEnumerable<AggregateFunction> functions)
Parameters
functions
IEnumerable<AggregateFunction>Aggregate function schema, provided by schema provider.
Returns
- IEnumerable<AggregateFunction>
Aggregate function schema with interceptor logic applied.
GetForeignKeys(IEnumerable<ForeignKey>)
Using this method you can add, remove or modify foreign key constrains schema information.
public virtual IEnumerable<ForeignKey> GetForeignKeys(IEnumerable<ForeignKey> keys)
Parameters
keys
IEnumerable<ForeignKey>Foreign key schema, provided by schema provider.
Returns
- IEnumerable<ForeignKey>
Foreign key schema with interceptor logic applied.
GetProcedures(IEnumerable<StoredProcedure>)
Using this method you can add, remove or modify stored procedure schema information.
public virtual IEnumerable<StoredProcedure> GetProcedures(IEnumerable<StoredProcedure> procedures)
Parameters
procedures
IEnumerable<StoredProcedure>Stored procedure schema, provided by schema provider.
Returns
- IEnumerable<StoredProcedure>
Stored procedure schema with interceptor logic applied.
GetScalarFunctions(IEnumerable<ScalarFunction>)
Using this method you can add, remove or modify scalar function schema information.
public virtual IEnumerable<ScalarFunction> GetScalarFunctions(IEnumerable<ScalarFunction> functions)
Parameters
functions
IEnumerable<ScalarFunction>Scalar function schema, provided by schema provider.
Returns
- IEnumerable<ScalarFunction>
Scalar function schema with interceptor logic applied.
GetTableFunctions(IEnumerable<TableFunction>)
Using this method you can add, remove or modify table function schema information.
public virtual IEnumerable<TableFunction> GetTableFunctions(IEnumerable<TableFunction> functions)
Parameters
functions
IEnumerable<TableFunction>Table function schema, provided by schema provider.
Returns
- IEnumerable<TableFunction>
Table function schema with interceptor logic applied.
GetTables(IEnumerable<Table>)
Using this method you can add, remove or modify table schema information.
public virtual IEnumerable<Table> GetTables(IEnumerable<Table> tables)
Parameters
tables
IEnumerable<Table>Table schema, provided by schema provider.
Returns
- IEnumerable<Table>
Table schema with interceptor logic applied.
GetTypeMapping(DatabaseType, ITypeParser, TypeMapping?)
Using this method you can specify which .NET type and DataType enum value to use with specific database type. Method called only once per database type. CLRType shouldn't be a nullable type, as nullability applied to it later automatically based on owning object (e.g. column or procedure parameter) nullability.
public virtual TypeMapping? GetTypeMapping(DatabaseType databaseType, ITypeParser typeParser, TypeMapping? defaultMapping)
Parameters
databaseType
DatabaseTypeDatabase type specification.
typeParser
ITypeParserType parser to create value for CLRType property from Type instance or type name string.
defaultMapping
TypeMappingDefault type mapping for specified
databaseType
.
Returns
- TypeMapping
Type mapping information for specified
databaseType
.
GetViews(IEnumerable<View>)
Using this method you can add, remove or modify view schema information.
public virtual IEnumerable<View> GetViews(IEnumerable<View> views)
Parameters
views
IEnumerable<View>View schema, provided by schema provider.
Returns
- IEnumerable<View>
View schema with interceptor logic applied.
PreprocessAggregateFunction(ITypeParser, AggregateFunctionModel)
Using this method user could modify aggregate function code generation options:
- Return type: ReturnType
- Function metadata: Metadata
- Method code-generation options: Method
- Parameters: Parameters
public virtual void PreprocessAggregateFunction(ITypeParser typeParser, AggregateFunctionModel functionModel)
Parameters
typeParser
ITypeParserType parser service to create type tokens.
functionModel
AggregateFunctionModelFunction model descriptor.
PreprocessAssociation(ITypeParser, AssociationModel)
Using this method user could modify association code generation options:
- Metadata for both sides of association: SourceMetadata and TargetMetadata
- Configure association properties in entity classes: Property and BackreferenceProperty
- Configure association extension methods: Extension and BackreferenceExtension
- Association cardinality: ManyToOne
public virtual void PreprocessAssociation(ITypeParser typeParser, AssociationModel associationModel)
Parameters
typeParser
ITypeParserType parser service to create type tokens.
associationModel
AssociationModelAssociation model descriptor.
PreprocessEntity(ITypeParser, EntityModel)
Using this method user could modify entity code generation options:
- modify associated table/view metadata descriptor: Metadata
- modify entity class code generation options including custom attributes: Class
- modify/add/remove data context table access property: ContextProperty
- edit list of generated Find/FindAsync/FindQuery extensions: FindExtensions
- modify column list: Columns including column metadata and property code generation options.
public virtual void PreprocessEntity(ITypeParser typeParser, EntityModel entityModel)
Parameters
typeParser
ITypeParserType parser service to create type tokens.
entityModel
EntityModelEntity model descriptor.
PreprocessScalarFunction(ITypeParser, ScalarFunctionModel)
Using this method user could modify scalar function code generation options:
- Return scalar value or tuple descriptor: Return or ReturnTuple
- Function metadata: Metadata
- Method code-generation options: Method
- Parameters: Parameters
public virtual void PreprocessScalarFunction(ITypeParser typeParser, ScalarFunctionModel functionModel)
Parameters
typeParser
ITypeParserType parser service to create type tokens.
functionModel
ScalarFunctionModelFunction model descriptor.
PreprocessStoredProcedure(ITypeParser, StoredProcedureModel)
Using this method user could modify stored procedure code generation options:
public virtual void PreprocessStoredProcedure(ITypeParser typeParser, StoredProcedureModel procedureModel)
Parameters
typeParser
ITypeParserType parser service to create type tokens.
procedureModel
StoredProcedureModelStored procedure model descriptor.
PreprocessTableFunction(ITypeParser, TableFunctionModel)
Using this method user could modify table function code generation options:
public virtual void PreprocessTableFunction(ITypeParser typeParser, TableFunctionModel functionModel)
Parameters
typeParser
ITypeParserType parser service to create type tokens.
functionModel
TableFunctionModelFunction model descriptor.