A settings related to entities can be parameterized largely on the Admin dashboard; however, in the case of a real application,
it is almost invariably necessary to include some additional code to achieve the functionality expected by the client.
Such expectations may include, for example, validations on the data, custom display styles dependent on the data, other logging activities,
communication with other modules or external applications, and numerous possible events that cannot be anticipated in advance by a framework.
To handle these, it is necessary to create unique classes in the RecroGrid Framework, and additional or modifying code can be developed for various events or phases of automatic processes.
Define
The server-side class of the RecroGrid Framework is the generic class RgfCore<TEntity>,
where the DbSet Entity class must be specified as the type parameter.
public partial class RG_Product : RgfCore<Product>
{
public RG_Product(IRecroGridContext rgContext) : base(rgContext) { }
}
Once the server-side class is created, in the Admin dashboard, under the RGF-Admin/Entities menu, you need to modify the name, type, and category of the previously generated Product Entity.
Continuing with our previous example, this would look like the following
- Name: RG_Product
- TypeDefinition: RGF.Demo.Northwind.Entities.RG_Product, RGF.Demo.Northwind
- Category: CustomClass
In the TypeDefinition, you need to provide the fully qualified name, including the assembly name. However, for the sake of simplicity and easier portability, you can simplify this using the following:
- DefaultNamespace: The default namespace where DBModel is located
- DefaultAssemblyName: The default assembly name where DBModel is located
- EntryAssemblyName: Default application domain
Based on these, you can simplify the previous example to: DefaultAssemblyName.Entities.RG_Product, DefaultAssemblyName