Functions
Table Of Contents
What are Functions?
This feature in The Sharp Factory Framework allows the developer to call SQL Functions.
These functions are bound to a particular SQL Schema.
The Sharp Factory App generates a method per SQL Function added to the model.
The naming convention is RepositoryContainer.{Model Name}.{SQL Schema}.Functions.{Function Name}
The parameters are wrapped in a Request class. The naming convention is {Function Name}_Request
Table Valued Functions
These functions return a list of entities. The Sharp Factory App generates an entity that represents the return type.
The following C# code sample shows how to consume a SQL Function called GetCustomersByCity.
Scalar Functions
These functions return a single scalar value.
The following C# code sample shows how to consume a SQL Function called CalculateCustomerPrice.