This project was bootstrapped with .NET Core. Code-First Workflow.
In the project directory, open it through Visual Studio and go to Tools / NuGet Package Manager / Console:
Add-Migration Name
-IgnoreChanges -Force to override
Update-Database
-TargetMigration:NameWithoutDateTime to revert (downgrade)
Remove-Migration
sqllocaldb i
sqllocaldb info mssqllocaldb
Task - used to implement Task-based Asynchronous Programming. The Task object is typically executed asynchronously on a thread pool thread rather than synchronously on the main thread of the application.
ActionResult - returning a specific data type. When multiple return types are possible, it's common to return ActionResult, IActionResult or ActionResult, where T represents the data type to be returned.
DbSet - represents a collection of all entities of a given type in your database. It acts as an in-memory representation of a database table, allowing you to perform CRUD operations on the data.
ICollection - provides basic functionality for working with collections, but doesn't guarantee any specific ordering or indexing of elements.
IList - Designed for collections where elements have a specific order and can be accessed by their position (index).
HashSet - powerful and efficient collection for storing unique elements when order is not important and fast lookups are required.
Data Annotation - when you use [Required] and etc.
Fluent API - when you use modelBuilder.Entity. Fluent because chainable.
virtualenables polymorphism through method overriding.
Open https://localhost:7261/swagger/index.html to view it in the browser.
Helps make query parameters efficient.
- $select = name,codename
- $filter = name eq 'Cuba'
- $orderby = name
- Data - for Data Transfer Objects.
- Models - for DataBase models.
{
"title": "Customer Satisfaction Survey",
"description": "This survey aims to collect feedback on our service."
}
{
"id": 1,
"title": "NPS",
"description": "Net promoter score."
}
First, you register a User, and then assign roles (Administrator | Manager) to them.
{
"email": "[email protected]",
"password": "P@s5word!"
}
Per 14/10/2024
The respondent can only fill in the survey.
Admin can:
- Manage managers.
- Assign other managers to surveys.
Manager
- Can Not see other survey results.
- View assigned survey results.
- Send report via webhook when respondent complete survey.
- Create constructor for questions (text, multiple / single choices).
- Validation for questions.
- Respondent management (email + status (invited, completed, opened, disabled)).
- Add Respondents via API and CSV import.
- When you add Respondent they should receive invitation email.
-
Create Base Entity. -
Respondent email: Key for 2 fields (Email + SurveyId)
-
If at least one respondend started the survey we should lock the Questions.
-
Update Swagger. List possible errors. -
Research about extension or package about Back Refs. -
Create script to create Super User (root). And verify at least one Admin remains in the DB.
-
Check how to properly set CreatedAt and UpdatedAt on the DB level or the Model level. HasDefaultValueSql("GETUTCDATE()");