Starts in:
1 DAY
11 HRS
34 MIN
13 SEC
Starts in:
1 D
11 H
34 M
13 S

Poll System

CMS kit provides a poll system to allow users to create, edit and delete polls. Here is a screenshot of the poll widget:

cmskit-module-poll-widget

User Interface

Menu Items

Polls: Opens the poll management page.

Pages

Polls

You can list, create, update and delete on the admin side of your solution.

poll-page poll-edit-question-page poll-edit-options-page

The Poll Widget

The poll system provides a poll widget for users to vote and show the result. You can place the widget on a page like the below:

@await Component.InvokeAsync(
    typeof(PollViewComponent),
    new
    {
        widgetName = "my-poll-1"
    })

Options

Before using the poll system, you need to define the widgets. You can use the CmsKitPollingOptions. CmsKitPollingOptions can be configured in the domain layer, in the ConfigureServices method of your module.

Example:

Configure<CmsKitPollingOptions>(options =>
    {
        options.AddWidget("my-poll-1");
    });

CmsKitPollingOptions properties:

  • WidgetNames: List of defined widgets in the poll system. options.AddWidget method was a shortcut to add a new widget to this list.

Internals

Domain Layer

Aggregates

This module follows the Entity Best Practices & Conventions guide.

Poll

A poll represents a created poll with its options.

  • Poll (aggregate root): Represents a poll by including the options in the system.
  • PollOption (entity): Represents the defined poll options related to the poll in the system.
PollUserVote

A poll user vote represents voted poll from a user.

  • PollUserVote (aggregate root): Represents poll user votes in the system.

Repositories

This module follows the Repository Best Practices & Conventions guide.

Following custom repositories are defined for these features:

  • IPollRepository
  • IPollUserVoteRepository

Domain services

This module follows the Domain Services Best Practices & Conventions guide.

Poll Manager

PollManager is used to perform some operations for the Poll aggregate root.

Application layer

Application services

  • PollAdminAppService (implements IPollAdminAppService): Implements the use cases of poll management for admin side.
  • PollPublicAppService (implements IPollPublicAppService): Implements the use cases of polls for public websites.

Database providers

Common

Table / collection prefix & schema

All tables/collections use the Cms prefix by default. Set static properties on the CmsKitDbProperties class if you need to change the table prefix or set a schema name (if supported by your database provider).

Connection string

This module uses CmsKit for the connection string name. If you don't define a connection string with this name, it fallbacks to the Default connection string.

See the connection strings documentation for details.

Entity Framework Core

Tables
  • CmsPolls
    • CmsPollOptions
  • CmsPollUserVotes

MongoDB

Collections
  • CmsPolls
  • CmsPollUserVotes

Contributors


Last updated: July 19, 2022 Edit this page on GitHub

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

In this document
Community Talks

What’s New with .NET 9 & ABP 9?

21 Nov, 17:00
Online
Watch the Event
Mastering ABP Framework Book
Mastering ABP Framework

This book will help you gain a complete understanding of the framework and modern web application development techniques.

Learn More