Registering Entity Classes and Creating CRUD Pages
In Bloqs, to allow editing of a certain entity class, you first need to register the class with the app builder. This connects the class to the storage and enables it for use in the application.
Registering an Entity Class
builder.AddEntityClass<Activity>(defaultStorage);Activity– The entity class you want to register.defaultStorage– The storage where instances of this class will be persisted.
Registering an entity class allows Bloqs to manage its data, but it does not automatically create UI pages.
Creating CRUD Pages
If you want to directly create CRUD pages for an entity class, without much effort, you can use:
var manageActivities = new MenuItem { Name = "Manage Activities" };
builder.AddCrudPagesForClass<Activity>(manageActivities);AddCrudPagesForClass<Activity>– Generates standard Create, Read, Update, and Delete pages for the entity.manageActivities– A parent menu item in the left drawer where these CRUD pages will be added.
This approach allows you to quickly expose entity management in the UI without manually creating pages or components.
Last updated