Stack: Blazor + API controllers, MSSQL Objective: Phonebook contacts Use: Dependency Injection MSSQL single table: Contact, field: FirstName, LastName, bool IsActive, datetime BirthDate, Email, TelephoneNumber
- overview of all contacts, search via FirstName, LastName
- search via birthdate from-to
- search via IsActive
- search via phone number, whether it is entered in the filter with or without spaces, i.e. in any way
- possibility to add a new contact
- possibility to go to the edit screen
- string fields
- date field
- checkbox for IsActive
- masked edit for phone number = display in segments of three digits (NNN NNN NNN)
- validation of the email that it is in the correct format
- display the current age of the contact, automatically on the fly recalculated when I change the BirthDate field
The application uses the entity framework to work with the database and uses migration. Therefore, before using the application, it is necessary to set up database migrations.
- ) Change the connection string in
appsettings.json
- ) In the server application directory, run the
dotnet ef database update
CLI command to apply the database migration
For instalation Entity Framework use CLI command
dotnet tool install --global dotnet-ef
- ) After applying migrations, you can run the application in VS