├── .gitignore ├── LICENSE ├── README.md ├── course-work ├── Implementations │ └── .gitkeep ├── README.md └── StartingPoint │ └── GroceryManager │ ├── GM.Models │ ├── GM.Models.csproj │ └── Grocery.cs │ ├── GM.Server │ ├── Controllers │ │ └── GroceriesController.cs │ ├── Data │ │ └── GroceryDbContext.cs │ ├── GM.Server.csproj │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── GroceryManager.sln ├── documentations ├── assessment-requirements.md ├── how-to-start.md ├── roadmap-wp.mup.png └── tools.md ├── examples ├── AzureCosmosDB.DatabaseManagement │ ├── AzureCosmosDB.DatabaseManagement.sln │ └── AzureCosmosDB.DatabaseManagement │ │ ├── AzureCosmosDB.DatabaseManagement.csproj │ │ ├── Book.cs │ │ └── Program.cs ├── BlazingPizza │ ├── BP.ApplicationServices │ │ ├── BP.ApplicationServices.csproj │ │ ├── Exceptions │ │ │ └── ResourceNotFoundException.cs │ │ ├── Implementations │ │ │ ├── ApplicationServiceBase.cs │ │ │ └── PizzaService.cs │ │ ├── Interfaces │ │ │ └── IPizzaService.cs │ │ ├── Messaging │ │ │ ├── GuidIdRequest.cs │ │ │ ├── NameRequest.cs │ │ │ ├── Pizzas │ │ │ │ ├── DeletePizzaRequest.cs │ │ │ │ ├── DeletePizzaResponse.cs │ │ │ │ ├── GetPizzaByNameRequest.cs │ │ │ │ ├── GetPizzaRequest.cs │ │ │ │ ├── GetPizzaResponse.cs │ │ │ │ ├── GetPizzasResponse.cs │ │ │ │ ├── InsertPizzaRequest.cs │ │ │ │ ├── InsertPizzaResponse.cs │ │ │ │ ├── PizzaPropertiesVM.cs │ │ │ │ ├── UpdatePizzaRequest.cs │ │ │ │ ├── UpdatePizzaResponse.cs │ │ │ │ └── UpdatePizzaVM.cs │ │ │ ├── ServiceRequestBase.cs │ │ │ └── ServiceResponseBase.cs │ │ ├── ModelConversions │ │ │ └── ConversionHelper.cs │ │ └── ViewModels │ │ │ └── PizzaViewModel.cs │ ├── BP.Domain │ │ ├── BP.Domain.csproj │ │ ├── Pizza │ │ │ ├── IPizzaRepository.cs │ │ │ ├── Pizza.cs │ │ │ └── PizzaBusinessRule.cs │ │ └── ValueObjects │ │ │ ├── Recipe.cs │ │ │ └── ValueObjectBusinessRule.cs │ ├── BP.Infrastructure │ │ ├── BP.Infrastructure.csproj │ │ └── Domain │ │ │ ├── BusinessRule.cs │ │ │ ├── EntityBase.cs │ │ │ ├── IAggregateRoot.cs │ │ │ ├── IReadOnlyRepository.cs │ │ │ ├── IRepository.cs │ │ │ ├── ValueObjectBase.cs │ │ │ └── ValueObjectIsInvalidExecption.cs │ ├── BP.Repository │ │ ├── BP.Repository.csproj │ │ ├── DataBase │ │ │ ├── DatabasePizza.cs │ │ │ └── Entity.cs │ │ ├── Repositories │ │ │ └── PizzaRepository.cs │ │ └── Repository.cs │ ├── BP.WebAPIServices │ │ ├── BP.WebAPIServices.csproj │ │ ├── Controllers │ │ │ └── PizzasController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ └── BlazingPizza.sln ├── BlazorBaseProject │ ├── BlazorBaseProject.sln │ └── BlazorBaseProject │ │ ├── App.razor │ │ ├── BlazorBaseProject.csproj │ │ ├── Data │ │ ├── WeatherForecast.cs │ │ └── WeatherForecastService.cs │ │ ├── Pages │ │ ├── Counter.razor │ │ ├── Error.cshtml │ │ ├── Error.cshtml.cs │ │ ├── FetchData.razor │ │ ├── Index.razor │ │ └── _Host.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ └── SurveyPrompt.razor │ │ ├── Startup.cs │ │ ├── _Imports.razor │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ ├── css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ │ ├── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ └── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.svg │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ └── site.css │ │ └── favicon.ico ├── ParkingManagement │ ├── PM.WebServices.sln │ └── PM.WebServices │ │ ├── Commands │ │ ├── CloseParkingCommand.cs │ │ ├── CreateParkingCommand.cs │ │ ├── Handlers │ │ │ └── ParkingCommandHandler.cs │ │ ├── LeaveParkingPlaceCommand.cs │ │ ├── OpenParkingCommand.cs │ │ └── TakeParkingPlaceCommand.cs │ │ ├── Controllers │ │ └── ParkingController.cs │ │ ├── Messaging │ │ ├── Requests │ │ │ └── CreateParkingRequest.cs │ │ └── Responses │ │ │ ├── ParkingInfo.cs │ │ │ └── ParkingPlaceInfo.cs │ │ ├── Migrations │ │ ├── 20190706101240_InitialMigration.Designer.cs │ │ ├── 20190706101240_InitialMigration.cs │ │ ├── 20190706102057_RemoveUser.Designer.cs │ │ ├── 20190706102057_RemoveUser.cs │ │ ├── 20190706102405_AddParkingFK.Designer.cs │ │ ├── 20190706102405_AddParkingFK.cs │ │ ├── 20201107171152_pp.Designer.cs │ │ ├── 20201107171152_pp.cs │ │ └── ParkingContextModelSnapshot.cs │ │ ├── Models │ │ ├── Command.cs │ │ ├── Parking.cs │ │ ├── ParkingContext.cs │ │ └── ParkingPlace.cs │ │ ├── PM.WebServices.csproj │ │ ├── Program.cs │ │ ├── Queries │ │ ├── GetAllParkingInfoQuery.cs │ │ ├── GetParkingInfoQuery.cs │ │ ├── GetRandomAvailablePlace.cs │ │ ├── GetTotalAvailablePlacesQuery.cs │ │ └── Handlers │ │ │ └── ParkingQueryHandler.cs │ │ ├── Services │ │ ├── AuthenticationService.cs │ │ └── CommandStoreService.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json ├── StudentManagement │ ├── SM.Website │ │ ├── Areas │ │ │ └── Identity │ │ │ │ └── Pages │ │ │ │ └── _ViewStart.cshtml │ │ ├── Data │ │ │ ├── ApplicationDbContext.cs │ │ │ ├── Entities │ │ │ │ ├── Specialty.cs │ │ │ │ └── Student.cs │ │ │ └── Migrations │ │ │ │ ├── 00000000000000_CreateIdentitySchema.Designer.cs │ │ │ │ ├── 00000000000000_CreateIdentitySchema.cs │ │ │ │ ├── 20181116132536_TableStudent.Designer.cs │ │ │ │ ├── 20181116132536_TableStudent.cs │ │ │ │ ├── 20181116140805_tablSpecialty.Designer.cs │ │ │ │ ├── 20181116140805_tablSpecialty.cs │ │ │ │ ├── 20181117151122_NewColumn.Designer.cs │ │ │ │ ├── 20181117151122_NewColumn.cs │ │ │ │ ├── 20221105124000_update.Designer.cs │ │ │ │ ├── 20221105124000_update.cs │ │ │ │ └── ApplicationDbContextModelSnapshot.cs │ │ ├── Pages │ │ │ ├── About.cshtml │ │ │ ├── About.cshtml.cs │ │ │ ├── Contact.cshtml │ │ │ ├── Contact.cshtml.cs │ │ │ ├── Error.cshtml │ │ │ ├── Error.cshtml.cs │ │ │ ├── HomeIndex.cshtml │ │ │ ├── HomeIndex.cshtml.cs │ │ │ ├── Privacy.cshtml │ │ │ ├── Privacy.cshtml.cs │ │ │ ├── Shared │ │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _LoginPartial.cshtml │ │ │ │ └── _ValidationScriptsPartial.cshtml │ │ │ ├── Specialtys │ │ │ │ ├── Create.cshtml │ │ │ │ ├── Create.cshtml.cs │ │ │ │ ├── Delete.cshtml │ │ │ │ ├── Delete.cshtml.cs │ │ │ │ ├── Details.cshtml │ │ │ │ ├── Details.cshtml.cs │ │ │ │ ├── Edit.cshtml │ │ │ │ ├── Edit.cshtml.cs │ │ │ │ ├── Index.cshtml │ │ │ │ └── Index.cshtml.cs │ │ │ ├── Students │ │ │ │ ├── Create.cshtml │ │ │ │ ├── Create.cshtml.cs │ │ │ │ ├── Delete.cshtml │ │ │ │ ├── Delete.cshtml.cs │ │ │ │ ├── Details.cshtml │ │ │ │ ├── Details.cshtml.cs │ │ │ │ ├── Edit.cshtml │ │ │ │ ├── Edit.cshtml.cs │ │ │ │ ├── Index.cshtml │ │ │ │ └── Index.cshtml.cs │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── Program.cs │ │ ├── SM.Website.csproj │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ └── banner3.svg │ │ │ ├── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── .bower.json │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ └── StudentManagement.sln └── ToDoOperations │ ├── ToDoOperations.sln │ └── ToDoOperations │ ├── .gitignore │ ├── CreateToDoItem.cs │ ├── DocByIdFromRouteData.cs │ ├── DocCreateToDoItem.cs │ ├── DocDeleteToDoItem.cs │ ├── DocUpdateToDoItem.cs │ ├── DocsBySqlQuery.cs │ ├── ToDoItem.cs │ ├── ToDoOperations.csproj │ ├── UpdateToDoItem.cs │ └── host.json ├── exercises ├── 01 │ ├── BaseTrainingProject │ │ ├── BaseTrainingProject.sln │ │ └── BaseTrainingProject │ │ │ ├── App.razor │ │ │ ├── BaseTrainingProject.csproj │ │ │ ├── Data │ │ │ ├── WeatherForecast.cs │ │ │ └── WeatherForecastService.cs │ │ │ ├── Pages │ │ │ ├── Calculator.razor │ │ │ ├── Counter.razor │ │ │ ├── Error.cshtml │ │ │ ├── Error.cshtml.cs │ │ │ ├── FetchData.razor │ │ │ ├── Index.razor │ │ │ ├── MyFirstRazorComponent.razor │ │ │ ├── MySecondRazorComponent.razor │ │ │ └── _Host.cshtml │ │ │ ├── Program.cs │ │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── MainLayout.razor.css │ │ │ ├── NavMenu.razor │ │ │ ├── NavMenu.razor.css │ │ │ └── SurveyPrompt.razor │ │ │ ├── Startup.cs │ │ │ ├── _Imports.razor │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── open-iconic │ │ │ │ ├── FONT-LICENSE │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── font │ │ │ │ │ ├── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.svg │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ └── site.css │ │ │ └── favicon.ico │ └── WorkOutManager │ │ ├── WOM.Client │ │ ├── App.razor │ │ ├── Data │ │ │ ├── IWorkOutDataAccess.cs │ │ │ └── WorkOutSimpleData.cs │ │ ├── Pages │ │ │ ├── Error.cshtml │ │ │ ├── Index.razor │ │ │ └── _Host.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── NavMenu.razor │ │ │ ├── WorkOutErrors.razor │ │ │ ├── WorkOutList.razor │ │ │ └── WorkOutShow.razor │ │ ├── Startup.cs │ │ ├── ViewModels │ │ │ └── WorkOutViewModel.cs │ │ ├── WOM.Client.csproj │ │ ├── _Imports.razor │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── open-iconic │ │ │ │ ├── FONT-LICENSE │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── font │ │ │ │ │ ├── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.svg │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ └── site.css │ │ │ └── favicon.ico │ │ ├── WOM.Models │ │ ├── WOM.Models.csproj │ │ └── WorkOut.cs │ │ ├── WOM.Server │ │ ├── Controllers │ │ │ └── WorkOutsController.cs │ │ ├── Data │ │ │ └── WorkOutContext.cs │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── WOM.Server.csproj │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ │ └── WorkOutManager.sln ├── 02 │ └── WorkOutManager │ │ ├── WOM.Client │ │ ├── App.razor │ │ ├── Data │ │ │ ├── IWorkOutDataAccess.cs │ │ │ ├── MockWorkOutSimpleData.cs │ │ │ └── WorkOutSimpleData.cs │ │ ├── Pages │ │ │ ├── Error.cshtml │ │ │ ├── Index.razor │ │ │ └── _Host.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── NavMenu.razor │ │ │ ├── WorkOutErrors.razor │ │ │ ├── WorkOutList.razor │ │ │ └── WorkOutShow.razor │ │ ├── Startup.cs │ │ ├── ViewModels │ │ │ └── WorkOutViewModel.cs │ │ ├── WOM.Client.csproj │ │ ├── _Imports.razor │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── open-iconic │ │ │ │ ├── FONT-LICENSE │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── font │ │ │ │ │ ├── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.svg │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ └── site.css │ │ │ └── favicon.ico │ │ ├── WOM.Models │ │ ├── WOM.Models.csproj │ │ └── WorkOut.cs │ │ ├── WOM.Server │ │ ├── Controllers │ │ │ └── WorkOutsController.cs │ │ ├── Data │ │ │ └── WorkOutContext.cs │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── WOM.Server.csproj │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ │ └── WorkOutManager.sln ├── README.md └── StartingPoint │ └── WorkOutManager │ ├── MockWorkOutSimpleData.cs │ ├── WOM.Models │ ├── WOM.Models.csproj │ └── WorkOut.cs │ ├── WOM.Server │ ├── Controllers │ │ └── WorkOutsController.cs │ ├── Data │ │ └── WorkOutContext.cs │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Startup.cs │ ├── WOM.Server.csproj │ ├── appsettings.Development.json │ └── appsettings.json │ └── WorkOutManager.sln └── presentations ├── Lecture-01.pdf ├── Lecture-02.pdf ├── Lecture-03.pdf ├── Lecture-04.pdf ├── Lecture-05.pdf ├── Lecture-06.pdf ├── Lecture-07.pdf ├── Lecture-08.pdf ├── Lecture-09.pdf ├── Lecture-10.pdf ├── Lecture-11.pdf ├── Lecture-12.pdf └── Lecture-13.pdf /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Pavel Kyurkchiev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /course-work/Implementations/.gitkeep: -------------------------------------------------------------------------------- 1 | # just a dumb file to make Git keep this directory as needed to exist for mounts to work -------------------------------------------------------------------------------- /course-work/README.md: -------------------------------------------------------------------------------- 1 | # Курсова работа 2 | 3 | 1. Условие\ 4 | Да се изработи система за управление на списък с хранителни стоки. 5 | 6 | 2. Задължителни изисквания за проекта\ 7 | Уеб приложението трябва да предоставя следната функционалност: добавяне на хранителни стоки, изтриване на хранителни стоки и маркиране на стоките като развалени. При маркиране на стоките като развалени те трябва да бъдат изваждани от списъка, но не и изтривани. Трябва да има възможност и за преглеждане на всички развалени стоки. 8 | 9 | 3. Позволен технологичен стак\ 10 | * C#, .Net Core Blazor или някой SPA Framework (Angular, React, Vue ....) 11 | 12 | 4. Допълнителна информация\ 13 | ПОЖЕЛАНИЕ като оправна точка може да се използва проекта course-work/StartingPoint. Този проект e OData API система предоставяща възможност за работа с данни от In-Memory storage. Модела на данни е: 14 | ``` 15 | public class Grocery 16 | { 17 | public int Id { get; set; } 18 | public bool IsExpire { get; set; } 19 | public DateTime? ExpireOn { get; set; } 20 | public DateTime CreatedOn { get; set; } 21 | 22 | [Required(ErrorMessage = "Name is required.")] 23 | public string Name { get; set; } 24 | } 25 | ``` 26 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Models/GM.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | GM.Models 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Models/Grocery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace GM.Models 5 | { 6 | public class Grocery 7 | { 8 | public Grocery() 9 | { 10 | CreatedOn = DateTime.UtcNow; 11 | } 12 | 13 | public int Id { get; set; } 14 | public bool IsExpire { get; set; } 15 | public DateTime? ExpireOn { get; set; } 16 | public DateTime CreatedOn { get; set; } 17 | 18 | [Required(ErrorMessage = "Name is required.")] 19 | public string Name { get; set; } 20 | 21 | public void MarkAsExpire() 22 | { 23 | if (!IsExpire) 24 | { 25 | IsExpire = true; 26 | ExpireOn = DateTime.UtcNow; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Server/Data/GroceryDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using GM.Models; 3 | 4 | namespace GM.Server.Data 5 | { 6 | public class GroceryDbContext : DbContext 7 | { 8 | public GroceryDbContext(DbContextOptions options) : base(options) 9 | { } 10 | 11 | public DbSet Groceries { get; set; } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Server/GM.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Server/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace GM.Server.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace GM.Server 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GM.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /course-work/StartingPoint/GroceryManager/GroceryManager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29424.173 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GM.Models", "GM.Models\GM.Models.csproj", "{2E6D3F2C-D625-4FEE-B989-CF5644803CEC}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GM.Server", "GM.Server\GM.Server.csproj", "{33E18F21-EE77-4735-AED8-BED426945760}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {33E18F21-EE77-4735-AED8-BED426945760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {33E18F21-EE77-4735-AED8-BED426945760}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {33E18F21-EE77-4735-AED8-BED426945760}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {33E18F21-EE77-4735-AED8-BED426945760}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {0708D0D6-C8AF-43C2-A28F-7A8256DEC83D} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /documentations/assessment-requirements.md: -------------------------------------------------------------------------------- 1 | ### Крайна оценка по дисциплината 2 | Крайната оценка е средноаритметичното на други две оценки: оценка практика и оценка теория 3 | * Оценка практика - представлява оценка от проект. Проекта се ЗАЩИТАВА по време изпитната сесия. Проекта е ИНДИВИДУАЛЕН и се разработва самостоятелно. 4 | * Оценка теория - покрит тест по време на изпитната сесия. Теста се състои от 15 затворени въпроса върху цялата теория. 5 | * Среден 3 - 8 точки 6 | * Среден 3.25 - 9 точки 7 | * Добър 3.5 - 10 точки 8 | * Добър 4 - 11 точки 9 | * Много Добър 4.5 - 12 точки 10 | * Много Добър 5 - 13 точки 11 | * Отличен 5.5 - 14 точки 12 | * Отличен 6 - 15 точки 13 | 14 | #### Не е задължително покриването и на двата компонента за да се счете крайната оценка за положителна. 15 | 16 | Пример: 17 | (Слаб 2 (оценка теория) + Добър 4 (практика)) / 2 = Среден 3 (крайна оценка) 18 | -------------------------------------------------------------------------------- /documentations/how-to-start.md: -------------------------------------------------------------------------------- 1 | # ASP.NET Core web applications 2 | 3 | 4 | 5 | **1. ASP.NET Core MVC** - *[link](https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/?view=aspnetcore-6.0)* 6 | 7 | **2. ASP.NET Core Razor Pages** - *[link](https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/?view=aspnetcore-6.0)* 8 | -------------------------------------------------------------------------------- /documentations/roadmap-wp.mup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/documentations/roadmap-wp.mup.png -------------------------------------------------------------------------------- /documentations/tools.md: -------------------------------------------------------------------------------- 1 | ### Tools for start the projects 2 | * Create Microsoft account 3 | * Visual Studio 2022 Community Edition 4 | * ASP.NET and web development 5 | * .Net 7 - [link](https://dotnet.microsoft.com/download/dotnet/7.0) 6 | * .Net Framework 4.8 - [link](https://dotnet.microsoft.com/download/dotnet-framework) 7 | * NodeJS [link](https://nodejs.org/en/) 8 | -------------------------------------------------------------------------------- /examples/AzureCosmosDB.DatabaseManagement/AzureCosmosDB.DatabaseManagement.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28803.352 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureCosmosDB.DatabaseManagement", "AzureCosmosDB.DatabaseManagement\AzureCosmosDB.DatabaseManagement.csproj", "{8D7000E8-43D2-4D3F-9980-92D9F032C122}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8D7000E8-43D2-4D3F-9980-92D9F032C122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {8D7000E8-43D2-4D3F-9980-92D9F032C122}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {8D7000E8-43D2-4D3F-9980-92D9F032C122}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {8D7000E8-43D2-4D3F-9980-92D9F032C122}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {B09473FB-B622-4790-B5AF-2F6C56A03791} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/AzureCosmosDB.DatabaseManagement/AzureCosmosDB.DatabaseManagement/AzureCosmosDB.DatabaseManagement.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/AzureCosmosDB.DatabaseManagement/AzureCosmosDB.DatabaseManagement/Book.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | 4 | namespace AzureCosmosDB.DatabaseManagement 5 | { 6 | public class Book 7 | { 8 | [JsonProperty(PropertyName = "id")] 9 | public string Id { get; set; } 10 | public string Title { get; set; } 11 | public decimal Price { get; set; } 12 | public string ISBN { get; set; } 13 | public List Authors { get; set; } 14 | public int PageCount { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/BP.ApplicationServices.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Exceptions/ResourceNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Exceptions 4 | { 5 | public class ResourceNotFoundException : Exception 6 | { 7 | public ResourceNotFoundException(string message) 8 | : base(message) 9 | { } 10 | 11 | public ResourceNotFoundException() 12 | : base("The requested resource was not found.") 13 | { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Implementations/ApplicationServiceBase.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Implementations 2 | { 3 | public abstract class ApplicationServiceBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Interfaces/IPizzaService.cs: -------------------------------------------------------------------------------- 1 | using BP.ApplicationServices.Messaging.Pizzas; 2 | 3 | namespace BP.ApplicationServices.Interfaces 4 | { 5 | public interface IPizzaService 6 | { 7 | GetPizzasResponse GetAll(); 8 | GetPizzaResponse GetById(GetPizzaRequest getUserRequest); 9 | GetPizzaResponse GetByName(GetPizzaByNameRequest getPizzaByNameRequest); 10 | 11 | InsertPizzaResponse InsertPizza(InsertPizzaRequest insertUserRequest); 12 | UpdatePizzaResponse UpdatePizza(UpdatePizzaRequest updateUserRequest); 13 | DeletePizzaResponse DeletePizza(DeletePizzaRequest deleteUserRequest); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/GuidIdRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Messaging 4 | { 5 | public abstract class GuidIdRequest : ServiceRequestBase 6 | { 7 | private Guid _id; 8 | 9 | public GuidIdRequest(Guid id) 10 | { 11 | if (Guid.Empty == id) 12 | { 13 | throw new ArgumentException("ID must be positive."); 14 | } 15 | _id = id; 16 | } 17 | 18 | public Guid Id { get { return _id; } } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/NameRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Messaging 4 | { 5 | public abstract class NameRequest : ServiceRequestBase 6 | { 7 | public NameRequest(string name) 8 | { 9 | if (String.IsNullOrEmpty(name)) 10 | { 11 | throw new ArgumentException("Name must not be empty string."); 12 | } 13 | 14 | Name = name; 15 | } 16 | 17 | public string Name { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/DeletePizzaRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Messaging.Pizzas 4 | { 5 | public class DeletePizzaRequest : GuidIdRequest 6 | { 7 | public DeletePizzaRequest(Guid pizzaId) : base(pizzaId) 8 | { } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/DeletePizzaResponse.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging.Pizzas 2 | { 3 | public class DeletePizzaResponse : ServiceResponseBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/GetPizzaByNameRequest.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging.Pizzas 2 | { 3 | public class GetPizzaByNameRequest : NameRequest 4 | { 5 | public GetPizzaByNameRequest(string name) 6 | : base(name) { } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/GetPizzaRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Messaging.Pizzas 4 | { 5 | public class GetPizzaRequest : GuidIdRequest 6 | { 7 | public GetPizzaRequest(Guid pizzaId) 8 | : base(pizzaId) { } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/GetPizzaResponse.cs: -------------------------------------------------------------------------------- 1 | using BP.ApplicationServices.ViewModels; 2 | 3 | namespace BP.ApplicationServices.Messaging.Pizzas 4 | { 5 | public class GetPizzaResponse : ServiceResponseBase 6 | { 7 | public PizzaViewModel Pizza { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/GetPizzasResponse.cs: -------------------------------------------------------------------------------- 1 | using BP.ApplicationServices.ViewModels; 2 | using System.Collections.Generic; 3 | 4 | namespace BP.ApplicationServices.Messaging.Pizzas 5 | { 6 | public class GetPizzasResponse : ServiceResponseBase 7 | { 8 | public IEnumerable Pizzas { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/InsertPizzaRequest.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging.Pizzas 2 | { 3 | public class InsertPizzaRequest : ServiceRequestBase 4 | { 5 | public PizzaPropertiesVM PizzaProperties { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/InsertPizzaResponse.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging.Pizzas 2 | { 3 | public class InsertPizzaResponse : ServiceResponseBase 4 | { } 5 | } 6 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/PizzaPropertiesVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace BP.ApplicationServices.Messaging.Pizzas 5 | { 6 | public class PizzaPropertiesVM 7 | { 8 | public string Name { get; set; } 9 | public decimal Price { get; set; } 10 | public DateTime? LaunchDate { get; set; } 11 | public List Ingredients { get; set; } 12 | public double CookingTime { get; set; } 13 | public string Description { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/UpdatePizzaRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Messaging.Pizzas 4 | { 5 | public class UpdatePizzaRequest : GuidIdRequest 6 | { 7 | public UpdatePizzaRequest(Guid pizzaId) : base(pizzaId) 8 | { } 9 | 10 | public PizzaPropertiesVM PizzaProperties { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/UpdatePizzaResponse.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging.Pizzas 2 | { 3 | public class UpdatePizzaResponse : ServiceResponseBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/Pizzas/UpdatePizzaVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.ApplicationServices.Messaging.Pizzas 4 | { 5 | public class UpdatePizzaVM : PizzaPropertiesVM 6 | { 7 | public Guid Id { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/ServiceRequestBase.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging 2 | { 3 | public abstract class ServiceRequestBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/Messaging/ServiceResponseBase.cs: -------------------------------------------------------------------------------- 1 | namespace BP.ApplicationServices.Messaging 2 | { 3 | public abstract class ServiceResponseBase 4 | { 5 | public ServiceResponseBase() 6 | { 7 | this.StatusCode = System.Net.HttpStatusCode.OK; 8 | this.StatusDesciption = "OK"; 9 | } 10 | 11 | public System.Net.HttpStatusCode StatusCode { get; set; } 12 | public string StatusDesciption { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/ModelConversions/ConversionHelper.cs: -------------------------------------------------------------------------------- 1 | using BP.ApplicationServices.ViewModels; 2 | using BP.Domain.Pizza; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace BP.ApplicationServices.ModelConversions 8 | { 9 | public static class ConversionHelper 10 | { 11 | public static PizzaViewModel ConvertToViewModel(this Pizza pizza) 12 | { 13 | return new PizzaViewModel() 14 | { 15 | Name = pizza.Name, 16 | Price = pizza.Price, 17 | LaunchDate = pizza.LaunchDate, 18 | Ingredients = pizza.PizzaRecipe.Ingredients, 19 | CookingTime = pizza.PizzaRecipe.CookingTime, 20 | Description = pizza.PizzaRecipe.Description 21 | }; 22 | } 23 | 24 | public static IEnumerable ConvertToViewModels(this IEnumerable pizzas) 25 | { 26 | List customerViewModels = new List(); 27 | foreach (Pizza pizza in pizzas) 28 | { 29 | customerViewModels.Add(pizza.ConvertToViewModel()); 30 | } 31 | return customerViewModels; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.ApplicationServices/ViewModels/PizzaViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace BP.ApplicationServices.ViewModels 5 | { 6 | public class PizzaViewModel 7 | { 8 | public string Name { get; set; } 9 | public decimal Price { get; set; } 10 | public DateTime? LaunchDate { get; set; } 11 | public List Ingredients { get; set; } 12 | public double CookingTime { get; set; } 13 | public string Description { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Domain/BP.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Domain/Pizza/IPizzaRepository.cs: -------------------------------------------------------------------------------- 1 | using BP.Infrastructure.Domain; 2 | using System; 3 | 4 | namespace BP.Domain.Pizza 5 | { 6 | public interface IPizzaRepository : IRepository 7 | { 8 | Pizza FindByName(string name); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Domain/Pizza/Pizza.cs: -------------------------------------------------------------------------------- 1 | using BP.Domain.ValueObjects; 2 | using BP.Infrastructure.Domain; 3 | using System; 4 | 5 | namespace BP.Domain.Pizza 6 | { 7 | public class Pizza : EntityBase, IAggregateRoot 8 | { 9 | public string Name { get; set; } 10 | public decimal Price { get; set; } 11 | public DateTime? LaunchDate { get; set; } 12 | public Recipe PizzaRecipe { get; set; } 13 | protected override void Validate() 14 | { 15 | if (string.IsNullOrEmpty(Name)) 16 | { 17 | AddBrokenRule(PizzaBusinessRule.NameRequired); 18 | } 19 | PizzaRecipe.ThrowExceptionIfInvalid(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Domain/Pizza/PizzaBusinessRule.cs: -------------------------------------------------------------------------------- 1 | using BP.Infrastructure.Domain; 2 | 3 | namespace BP.Domain.Pizza 4 | { 5 | public static class PizzaBusinessRule 6 | { 7 | public static readonly BusinessRule NameRequired = new("A pizza must have a name."); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Domain/ValueObjects/Recipe.cs: -------------------------------------------------------------------------------- 1 | using BP.Infrastructure.Domain; 2 | using System.Collections.Generic; 3 | 4 | namespace BP.Domain.ValueObjects 5 | { 6 | public class Recipe : ValueObjectBase 7 | { 8 | public List Ingredients { get; set; } 9 | public double CookingTime { get; set; } 10 | public string Description { get; set; } 11 | 12 | protected override void Validate() 13 | { 14 | if (string.IsNullOrEmpty(Description)) 15 | { 16 | AddBrokenRule(ValueObjectBusinessRule.DescriptionInRecipeRequired); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Domain/ValueObjects/ValueObjectBusinessRule.cs: -------------------------------------------------------------------------------- 1 | using BP.Infrastructure.Domain; 2 | 3 | namespace BP.Domain.ValueObjects 4 | { 5 | public static class ValueObjectBusinessRule 6 | { 7 | public static readonly BusinessRule DescriptionInRecipeRequired = new("An recipe must have a description."); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/BP.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/BusinessRule.cs: -------------------------------------------------------------------------------- 1 | namespace BP.Infrastructure.Domain 2 | { 3 | public class BusinessRule 4 | { 5 | private string _ruleDescription; 6 | 7 | public BusinessRule(string ruleDescription) 8 | { 9 | _ruleDescription = ruleDescription; 10 | } 11 | 12 | public string RuleDescription 13 | { 14 | get 15 | { 16 | return _ruleDescription; 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/EntityBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace BP.Infrastructure.Domain 4 | { 5 | public abstract class EntityBase 6 | { 7 | private List _brokenRules = new(); 8 | 9 | public IdType Id { get; set; } 10 | 11 | protected abstract void Validate(); 12 | 13 | protected void AddBrokenRule(BusinessRule businessRule) 14 | { 15 | _brokenRules.Add(businessRule); 16 | } 17 | 18 | public IEnumerable GetBrokenRules() 19 | { 20 | _brokenRules.Clear(); 21 | Validate(); 22 | return _brokenRules; 23 | } 24 | 25 | public override bool Equals(object entity) 26 | { 27 | return entity != null 28 | && entity is EntityBase 29 | && this == (EntityBase)entity; 30 | } 31 | 32 | public override int GetHashCode() 33 | { 34 | return this.Id.GetHashCode(); 35 | } 36 | 37 | public static bool operator ==(EntityBase entity1, EntityBase entity2) 38 | { 39 | if ((object)entity1 == null && (object)entity2 == null) 40 | { 41 | return true; 42 | } 43 | 44 | if ((object)entity1 == null || (object)entity2 == null) 45 | { 46 | return false; 47 | } 48 | 49 | if (entity1.Id.ToString() == entity2.Id.ToString()) 50 | { 51 | return true; 52 | } 53 | 54 | return false; 55 | } 56 | 57 | public static bool operator !=(EntityBase entity1, EntityBase entity2) 58 | { 59 | return (!(entity1 == entity2)); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/IAggregateRoot.cs: -------------------------------------------------------------------------------- 1 | namespace BP.Infrastructure.Domain 2 | { 3 | public interface IAggregateRoot 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/IReadOnlyRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace BP.Infrastructure.Domain 4 | { 5 | public interface IReadOnlyRepository where AggregateType : IAggregateRoot 6 | { 7 | AggregateType FindBy(IdType id); 8 | IEnumerable FindAll(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/IRepository.cs: -------------------------------------------------------------------------------- 1 | namespace BP.Infrastructure.Domain 2 | { 3 | public interface IRepository 4 | : IReadOnlyRepository where AggregateType 5 | : IAggregateRoot 6 | { 7 | AggregateType Update(AggregateType aggregate); 8 | AggregateType Insert(AggregateType aggregate); 9 | void Delete(AggregateType aggregate); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/ValueObjectBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | 4 | namespace BP.Infrastructure.Domain 5 | { 6 | public abstract class ValueObjectBase 7 | { 8 | private List _brokenRules = new(); 9 | 10 | public ValueObjectBase() 11 | { 12 | } 13 | 14 | protected abstract void Validate(); 15 | 16 | public void ThrowExceptionIfInvalid() 17 | { 18 | _brokenRules.Clear(); 19 | Validate(); 20 | if (_brokenRules.Count > 0) 21 | { 22 | StringBuilder issues = new(); 23 | foreach (BusinessRule businessRule in _brokenRules) 24 | { 25 | issues.AppendLine(businessRule.RuleDescription); 26 | } 27 | 28 | throw new ValueObjectIsInvalidException(issues.ToString()); 29 | } 30 | } 31 | 32 | protected void AddBrokenRule(BusinessRule businessRule) 33 | { 34 | _brokenRules.Add(businessRule); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Infrastructure/Domain/ValueObjectIsInvalidExecption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BP.Infrastructure.Domain 4 | { 5 | public class ValueObjectIsInvalidException : Exception 6 | { 7 | public ValueObjectIsInvalidException(string message) 8 | : base(message) 9 | { } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Repository/BP.Repository.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Repository/DataBase/DatabasePizza.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace BP.Repository.DataBase 5 | { 6 | public class DatabasePizza : Entity 7 | { 8 | public string Name { get; set; } 9 | public decimal Price { get; set; } 10 | public DateTime? LaunchDate { get; set; } 11 | public List Ingredients { get; set; } 12 | public double CookingTime { get; set; } 13 | public string Description { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Repository/DataBase/Entity.cs: -------------------------------------------------------------------------------- 1 | namespace BP.Repository.DataBase 2 | { 3 | public abstract class Entity 4 | { 5 | public IdType Id { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.Repository/Repository.cs: -------------------------------------------------------------------------------- 1 | using BP.Infrastructure.Domain; 2 | using BP.Repository.DataBase; 3 | using MongoDB.Driver; 4 | 5 | namespace BP.Repository 6 | { 7 | public abstract class Repository 8 | where DomainType : IAggregateRoot 9 | where DatabaseType : Entity 10 | { 11 | private static IMongoClient _client = null; 12 | private static IMongoDatabase _database = null; 13 | protected static IMongoCollection _collection = null; 14 | 15 | public Repository() 16 | { 17 | _client = new MongoClient("mongodb://127.0.0.1:27017"); 18 | _database = _client.GetDatabase("CloudDataHubDb"); 19 | _collection = _database.GetCollection(typeof(DomainType).Name); 20 | } 21 | 22 | public virtual DomainType Update(DomainType aggregate) 23 | { 24 | 25 | var databaseObject = ConvertToDatabaseType(aggregate); 26 | var filter = _collection.Find(x => x.Id.Equals(databaseObject.Id)).Filter; 27 | _collection.ReplaceOne(filter, databaseObject); 28 | 29 | return ConvertToDomain(databaseObject); 30 | } 31 | 32 | public virtual DomainType Insert(DomainType aggregate) 33 | { 34 | var databaseObject = ConvertToDatabaseType(aggregate); 35 | _collection.InsertOne(databaseObject); 36 | 37 | return ConvertToDomain(databaseObject); 38 | } 39 | 40 | public virtual void Delete(DomainType aggregate) 41 | { 42 | var obj = ConvertToDatabaseType(aggregate); 43 | var filter = _collection.Find(x => x.Id.Equals(obj.Id)).Filter; 44 | _collection.DeleteOne(filter); 45 | } 46 | 47 | public abstract DomainType FindBy(IdType id); 48 | 49 | public abstract DatabaseType ConvertToDatabaseType(DomainType domainType); 50 | 51 | public abstract DomainType ConvertToDomain(DatabaseType databaseType); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.WebAPIServices/BP.WebAPIServices.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.WebAPIServices/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace BP.WebAPIServices 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.WebAPIServices/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/BlazingPizza/BP.WebAPIServices/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31727.386 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorBaseProject", "BlazorBaseProject\BlazorBaseProject.csproj", "{EBD7BD26-61E3-41ED-9E75-DF8E820028AD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {EBD7BD26-61E3-41ED-9E75-DF8E820028AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {EBD7BD26-61E3-41ED-9E75-DF8E820028AD}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {EBD7BD26-61E3-41ED-9E75-DF8E820028AD}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {EBD7BD26-61E3-41ED-9E75-DF8E820028AD}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {452B62F5-7727-4C0C-8AD8-4028DE68EF49} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/BlazorBaseProject.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazorBaseProject.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BlazorBaseProject.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | Random rng = new(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model BlazorBaseProject.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using Microsoft.Extensions.Logging; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Diagnostics; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace BlazorBaseProject.Pages 11 | { 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 13 | [IgnoreAntiforgeryToken] 14 | public class ErrorModel : PageModel 15 | { 16 | public string RequestId { get; set; } 17 | 18 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 19 | 20 | private readonly ILogger _logger; 21 | 22 | public ErrorModel(ILogger logger) 23 | { 24 | _logger = logger; 25 | } 26 | 27 | public void OnGet() 28 | { 29 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | 3 | @using BlazorBaseProject.Data 4 | @inject WeatherForecastService ForecastService 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from a service.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorBaseProject.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | BlazorBaseProject 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | An error has occurred. This application may no longer respond until reloaded. 25 | 26 | 27 | An unhandled exception has occurred. See browser dev tools for details. 28 | 29 | Reload 30 | 🗙 31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace BlazorBaseProject 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | .main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .main > div { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 |  11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/Startup.cs: -------------------------------------------------------------------------------- 1 | using BlazorBaseProject.Data; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | namespace BlazorBaseProject 9 | { 10 | public class Startup 11 | { 12 | public Startup(IConfiguration configuration) 13 | { 14 | Configuration = configuration; 15 | } 16 | 17 | public IConfiguration Configuration { get; } 18 | 19 | // This method gets called by the runtime. Use this method to add services to the container. 20 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 21 | public void ConfigureServices(IServiceCollection services) 22 | { 23 | services.AddRazorPages(); 24 | services.AddServerSideBlazor(); 25 | services.AddSingleton(); 26 | } 27 | 28 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 29 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 30 | { 31 | if (env.IsDevelopment()) 32 | { 33 | app.UseDeveloperExceptionPage(); 34 | } 35 | else 36 | { 37 | app.UseExceptionHandler("/Error"); 38 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 39 | app.UseHsts(); 40 | } 41 | 42 | app.UseHttpsRedirection(); 43 | app.UseStaticFiles(); 44 | 45 | app.UseRouting(); 46 | 47 | app.UseEndpoints(endpoints => 48 | { 49 | endpoints.MapBlazorHub(); 50 | endpoints.MapFallbackToPage("/_Host"); 51 | }); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorBaseProject 10 | @using BlazorBaseProject.Shared 11 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | .content { 18 | padding-top: 1.1rem; 19 | } 20 | 21 | .valid.modified:not([type=checkbox]) { 22 | outline: 1px solid #26b050; 23 | } 24 | 25 | .invalid { 26 | outline: 1px solid red; 27 | } 28 | 29 | .validation-message { 30 | color: red; 31 | } 32 | 33 | #blazor-error-ui { 34 | background: lightyellow; 35 | bottom: 0; 36 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 37 | display: none; 38 | left: 0; 39 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 40 | position: fixed; 41 | width: 100%; 42 | z-index: 1000; 43 | } 44 | 45 | #blazor-error-ui .dismiss { 46 | cursor: pointer; 47 | position: absolute; 48 | right: 0.75rem; 49 | top: 0.5rem; 50 | } 51 | -------------------------------------------------------------------------------- /examples/BlazorBaseProject/BlazorBaseProject/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/BlazorBaseProject/BlazorBaseProject/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30621.155 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PM.WebServices", "PM.WebServices\PM.WebServices.csproj", "{96665684-70A7-4A9A-97F0-873B3F9EFC7C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {96665684-70A7-4A9A-97F0-873B3F9EFC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {96665684-70A7-4A9A-97F0-873B3F9EFC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {96665684-70A7-4A9A-97F0-873B3F9EFC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {96665684-70A7-4A9A-97F0-873B3F9EFC7C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {295E3068-E5D2-40C2-B24B-D6736924266E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Commands/CloseParkingCommand.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Commands 2 | { 3 | public class CloseParkingCommand 4 | { 5 | public string ParkingName { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Commands/CreateParkingCommand.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Commands 2 | { 3 | public class CreateParkingCommand 4 | { 5 | public string ParkingName { get; set; } 6 | public int Capacity { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Commands/LeaveParkingPlaceCommand.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Commands 2 | { 3 | public class LeaveParkingPlaceCommand 4 | { 5 | public string ParkingName { get; set; } 6 | public int PlaceNumber { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Commands/OpenParkingCommand.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Commands 2 | { 3 | public class OpenParkingCommand 4 | { 5 | public string ParkingName { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Commands/TakeParkingPlaceCommand.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Commands 2 | { 3 | public class TakeParkingPlaceCommand 4 | { 5 | public string ParkingName { get; set; } 6 | public int PlaceNumber { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Messaging/Requests/CreateParkingRequest.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Messaging.Requests 2 | { 3 | public class CreateParkingRequest 4 | { 5 | public string ParkingName { get; set; } 6 | public int Capacity { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Messaging/Responses/ParkingInfo.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Messaging.Responses 2 | { 3 | public class ParkingInfo 4 | { 5 | public string Name { get; set; } 6 | public bool IsOpened { get; set; } 7 | public int MaximumPlaces { get; set; } 8 | public int AvailablePlaces { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Messaging/Responses/ParkingPlaceInfo.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Messaging.Responses 2 | { 3 | public class ParkingPlaceInfo 4 | { 5 | public string ParkingName { get; set; } 6 | public int Number { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Migrations/20190706102405_AddParkingFK.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace PM.WebServices.Migrations 4 | { 5 | public partial class AddParkingFK : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | 10 | } 11 | 12 | protected override void Down(MigrationBuilder migrationBuilder) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Migrations/20201107171152_pp.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace PM.WebServices.Migrations 4 | { 5 | public partial class pp : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | 10 | } 11 | 12 | protected override void Down(MigrationBuilder migrationBuilder) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Models/Command.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PM.WebServices.Models 4 | { 5 | public class Command 6 | { 7 | public long Id { get; set; } 8 | public string Type { get; set; } 9 | public string Data { get; set; } 10 | public DateTime CreatedAt { get; set; } 11 | public string UserId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Models/Parking.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace PM.WebServices.Models 4 | { 5 | public class Parking 6 | { 7 | public string Name { get; set; } 8 | public bool IsOpened { get; set; } 9 | 10 | public List Places { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Models/ParkingContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace PM.WebServices.Models 4 | { 5 | public class ParkingContext : DbContext 6 | { 7 | public ParkingContext(DbContextOptions options) 8 | : base(options) 9 | { } 10 | 11 | public DbSet Parking { get; set; } 12 | public DbSet ParkingPlaces { get; set; } 13 | public DbSet CommandStore { get; set; } 14 | 15 | protected override void OnModelCreating(ModelBuilder modelBuilder) 16 | { 17 | modelBuilder.Entity() 18 | .HasKey(p => p.Name); 19 | modelBuilder.Entity() 20 | .HasMany(p => p.Places) 21 | .WithOne(p => p.Parking) 22 | .HasForeignKey(p => p.ParkingName) 23 | .IsRequired(); 24 | 25 | modelBuilder.Entity() 26 | .HasKey(p => new { p.ParkingName, p.Number }); 27 | 28 | modelBuilder.Entity() 29 | .HasKey(c => c.Id); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Models/ParkingPlace.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Models 2 | { 3 | public class ParkingPlace 4 | { 5 | public string ParkingName { get; set; } 6 | public int Number { get; set; } 7 | 8 | public bool IsFree { get; set; } 9 | public string UserId { get; set; } 10 | 11 | public Parking Parking { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/PM.WebServices.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0 5 | InProcess 6 | PM.WebServices 7 | PM.WebServices 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace PM.WebServices 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Queries/GetAllParkingInfoQuery.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Queries 2 | { 3 | public class GetAllParkingInfoQuery 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Queries/GetParkingInfoQuery.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Queries 2 | { 3 | public class GetParkingInfoQuery 4 | { 5 | public string ParkingName { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Queries/GetRandomAvailablePlace.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Queries 2 | { 3 | public class GetRandomAvailablePlace 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Queries/GetTotalAvailablePlacesQuery.cs: -------------------------------------------------------------------------------- 1 | namespace PM.WebServices.Queries 2 | { 3 | public class GetTotalAvailablePlacesQuery 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Services/AuthenticationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PM.WebServices.Services 4 | { 5 | public class AuthenticationService 6 | { 7 | private readonly string _userId; 8 | 9 | public AuthenticationService() 10 | { 11 | _userId = Guid.NewGuid().ToString(); 12 | } 13 | 14 | public string GetUserId() => _userId; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/Services/CommandStoreService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Newtonsoft.Json; 3 | using PM.WebServices.Models; 4 | using System; 5 | 6 | namespace PM.WebServices.Services 7 | { 8 | public class CommandStoreService 9 | { 10 | private readonly DbContext _dbContext; 11 | private readonly AuthenticationService _authenticationService; 12 | 13 | public CommandStoreService( 14 | DbContext dbContext, 15 | AuthenticationService authenticationService 16 | ) 17 | { 18 | _dbContext = dbContext; 19 | _authenticationService = authenticationService; 20 | } 21 | 22 | public void Push(object command) 23 | { 24 | _dbContext.Set().Add( 25 | new Command 26 | { 27 | Type = command.GetType().Name, 28 | Data = JsonConvert.SerializeObject(command), 29 | CreatedAt = DateTime.Now, 30 | UserId = _authenticationService.GetUserId() 31 | } 32 | ); 33 | _dbContext.SaveChanges(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/ParkingManagement/PM.WebServices/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=tcp:127.0.0.1,5433;Database=CQRS.ParkingDb;User Id=sa;Password=Pass@word;" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Warning" 8 | } 9 | }, 10 | "AllowedHosts": "*" 11 | } 12 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Areas/Identity/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Pages/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore; 3 | using SM.Website.Data.Entities; 4 | 5 | namespace SM.Website.Data 6 | { 7 | public class ApplicationDbContext : IdentityDbContext 8 | { 9 | public ApplicationDbContext(DbContextOptions options) : base(options) { } 10 | 11 | public DbSet Students { get; set; } 12 | public DbSet Specialtys { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Data/Entities/Specialty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | 6 | namespace SM.Website.Data.Entities 7 | { 8 | public class Specialty 9 | { 10 | [Key] 11 | public int Id { get; set; } 12 | 13 | [Required, StringLength(50, MinimumLength = 3)] 14 | public string Name { get; set; } 15 | 16 | [Range(50, 1000), DataType(DataType.Currency)] 17 | [Column(TypeName = "decimal(18, 2)")] 18 | public decimal Price { get; set; } 19 | 20 | public virtual ICollection? Students { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Data/Entities/Student.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace SM.Website.Data.Entities 5 | { 6 | public class Student 7 | { 8 | [Key] 9 | public int Id { get; set; } 10 | [Display(Name = "First name")] 11 | [Required, StringLength(300, MinimumLength = 3)] 12 | public string FirstName { get; set; } 13 | [Display(Name = "Last name")] 14 | [StringLength(300, MinimumLength = 3)] 15 | public string LastName { get; set; } 16 | [Display(Name = "Faculty number")] 17 | [Required, StringLength(10, MinimumLength = 3)] 18 | public string FacultyNumber { get; set; } 19 | 20 | [Display(Name = "Create date")] 21 | [DataType(DataType.Date)] 22 | public DateTime CreatedOn { get; set; } = DateTime.UtcNow; 23 | 24 | [Display(Name = "Specialty")] 25 | public int? SpecialtyId { get; set; } 26 | public virtual Specialty? Specialty { get; set; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Data/Migrations/20181116132536_TableStudent.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Metadata; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace SM.Website.Data.Migrations 5 | { 6 | public partial class TableStudent : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.CreateTable( 11 | name: "Students", 12 | columns: table => new 13 | { 14 | Id = table.Column(nullable: false) 15 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 16 | FirstName = table.Column(maxLength: 300, nullable: false), 17 | LastName = table.Column(maxLength: 300, nullable: true), 18 | FacultyNumber = table.Column(maxLength: 10, nullable: false) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_Students", x => x.Id); 23 | }); 24 | } 25 | 26 | protected override void Down(MigrationBuilder migrationBuilder) 27 | { 28 | migrationBuilder.DropTable( 29 | name: "Students"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Data/Migrations/20181117151122_NewColumn.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace SM.Website.Data.Migrations 4 | { 5 | public partial class NewColumn : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "Price", 11 | table: "Specialtys", 12 | type: "decimal(18, 2)", 13 | nullable: false, 14 | defaultValue: 0m); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.DropColumn( 20 | name: "Price", 21 | table: "Specialtys"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/About.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model AboutModel 3 | @{ 4 | ViewData["Title"] = "About"; 5 | } 6 |

@ViewData["Title"]

7 |

@Model.Message

8 | 9 |

Use this area to provide additional information.

10 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/About.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace SM.Website.Pages 8 | { 9 | public class AboutModel : PageModel 10 | { 11 | public string Message { get; set; } 12 | 13 | public void OnGet() 14 | { 15 | Message = "Your application description page."; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ContactModel 3 | @{ 4 | ViewData["Title"] = "Contact"; 5 | } 6 |

@ViewData["Title"]

7 |

@Model.Message

8 | 9 |
10 | One Microsoft Way
11 | Redmond, WA 98052-6399
12 | P: 13 | 425.555.0100 14 |
15 | 16 |
17 | Support: Support@example.com
18 | Marketing: Marketing@example.com 19 |
20 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Contact.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace SM.Website.Pages 8 | { 9 | public class ContactModel : PageModel 10 | { 11 | public string Message { get; set; } 12 | 13 | public void OnGet() 14 | { 15 | Message = "Your contact page."; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to Development environment will display more detailed information about the error that occurred. 20 |

21 |

22 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 23 |

24 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | 9 | namespace SM.Website.Pages 10 | { 11 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 12 | public class ErrorModel : PageModel 13 | { 14 | public string RequestId { get; set; } 15 | 16 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 17 | 18 | public void OnGet() 19 | { 20 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/HomeIndex.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace SM.Website.Pages 9 | { 10 | public class HomeIndexModel : PageModel 11 | { 12 | public void OnGet() 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

-------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace SM.Website.Pages 9 | { 10 | public class PrivacyModel : PageModel 11 | { 12 | public void OnGet() 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 33 | 41 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | 3 | @inject SignInManager SignInManager 4 | @inject UserManager UserManager 5 | 6 | @if (SignInManager.IsSignedIn(User)) 7 | { 8 | 18 | } 19 | else 20 | { 21 | 25 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Create.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Specialtys.CreateModel 3 | 4 | @{ 5 | ViewData["Title"] = "Create"; 6 | } 7 | 8 |

Create

9 | 10 |

Specialty

11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 |
22 | 23 | 24 | 25 |
26 |
27 | 28 |
29 |
30 |
31 |
32 | 33 |
34 | Back to List 35 |
36 | 37 | @section Scripts { 38 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 39 | } 40 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Create.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.AspNetCore.Mvc.Rendering; 9 | using SM.Website.Data; 10 | using SM.Website.Data.Entities; 11 | 12 | namespace SM.Website.Pages.Specialtys 13 | { 14 | [Authorize] 15 | public class CreateModel : PageModel 16 | { 17 | private readonly SM.Website.Data.ApplicationDbContext _context; 18 | 19 | public CreateModel(SM.Website.Data.ApplicationDbContext context) 20 | { 21 | _context = context; 22 | } 23 | 24 | public IActionResult OnGet() 25 | { 26 | return Page(); 27 | } 28 | 29 | [BindProperty] 30 | public Specialty Specialty { get; set; } 31 | 32 | public async Task OnPostAsync() 33 | { 34 | if (!ModelState.IsValid) 35 | { 36 | return Page(); 37 | } 38 | 39 | _context.Specialtys.Add(Specialty); 40 | await _context.SaveChangesAsync(); 41 | 42 | return RedirectToPage("./Index"); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Specialtys.DeleteModel 3 | 4 | @{ 5 | ViewData["Title"] = "Delete"; 6 | } 7 | 8 |

Delete

9 | 10 |

Are you sure you want to delete this?

11 |
12 |

Specialty

13 |
14 |
15 |
16 | @Html.DisplayNameFor(model => model.Specialty.Name) 17 |
18 |
19 | @Html.DisplayFor(model => model.Specialty.Name) 20 |
21 |
22 | @Html.DisplayNameFor(model => model.Specialty.Price) 23 |
24 |
25 | @Html.DisplayFor(model => model.Specialty.Price) 26 |
27 |
28 | 29 |
30 | 31 | | 32 | Back to List 33 |
34 |
35 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Delete.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using SM.Website.Data.Entities; 6 | using System.Threading.Tasks; 7 | 8 | namespace SM.Website.Pages.Specialtys 9 | { 10 | [Authorize] 11 | public class DeleteModel : PageModel 12 | { 13 | private readonly SM.Website.Data.ApplicationDbContext _context; 14 | 15 | public DeleteModel(SM.Website.Data.ApplicationDbContext context) 16 | { 17 | _context = context; 18 | } 19 | 20 | [BindProperty] 21 | public Specialty Specialty { get; set; } 22 | 23 | public async Task OnGetAsync(int? id) 24 | { 25 | if (id == null) 26 | { 27 | return NotFound(); 28 | } 29 | 30 | Specialty = await _context.Specialtys.FirstOrDefaultAsync(m => m.Id == id); 31 | 32 | if (Specialty == null) 33 | { 34 | return NotFound(); 35 | } 36 | return Page(); 37 | } 38 | 39 | public async Task OnPostAsync(int? id) 40 | { 41 | if (id == null) 42 | { 43 | return NotFound(); 44 | } 45 | 46 | Specialty = await _context.Specialtys.FindAsync(id); 47 | 48 | if (Specialty != null) 49 | { 50 | _context.Specialtys.Remove(Specialty); 51 | await _context.SaveChangesAsync(); 52 | } 53 | 54 | return RedirectToPage("./Index"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Details.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Specialtys.DetailsModel 3 | 4 | @{ 5 | ViewData["Title"] = "Details"; 6 | } 7 | 8 |

Details

9 | 10 |
11 |

Specialty

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Specialty.Name) 16 |
17 |
18 | @Html.DisplayFor(model => model.Specialty.Name) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Specialty.Price) 22 |
23 |
24 | @Html.DisplayFor(model => model.Specialty.Price) 25 |
26 |
27 |
28 |
29 | Edit | 30 | Back to List 31 |
32 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.EntityFrameworkCore; 9 | using SM.Website.Data; 10 | using SM.Website.Data.Entities; 11 | 12 | namespace SM.Website.Pages.Specialtys 13 | { 14 | [Authorize] 15 | public class DetailsModel : PageModel 16 | { 17 | private readonly SM.Website.Data.ApplicationDbContext _context; 18 | 19 | public DetailsModel(SM.Website.Data.ApplicationDbContext context) 20 | { 21 | _context = context; 22 | } 23 | 24 | public Specialty Specialty { get; set; } 25 | 26 | public async Task OnGetAsync(int? id) 27 | { 28 | if (id == null) 29 | { 30 | return NotFound(); 31 | } 32 | 33 | Specialty = await _context.Specialtys.FirstOrDefaultAsync(m => m.Id == id); 34 | 35 | if (Specialty == null) 36 | { 37 | return NotFound(); 38 | } 39 | return Page(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Specialtys.EditModel 3 | 4 | @{ 5 | ViewData["Title"] = "Edit"; 6 | } 7 | 8 |

Edit

9 | 10 |

Specialty

11 |
12 |
13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 | 21 |
22 |
23 | 24 | 25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 |
33 | 34 |
35 | Back to List 36 |
37 | 38 | @section Scripts { 39 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 40 | } 41 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Specialtys.IndexModel 3 | 4 | @{ 5 | ViewData["Title"] = "Index"; 6 | } 7 | 8 |

Index

9 | 10 |

11 | Create New 12 |

13 | 14 | 15 | 16 | 19 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Model.Specialty) { 27 | 28 | 31 | 34 | 39 | 40 | } 41 | 42 |
17 | @Html.DisplayNameFor(model => model.Specialty[0].Name) 18 | 20 | @Html.DisplayNameFor(model => model.Specialty[0].Price) 21 |
29 | @Html.DisplayFor(modelItem => item.Name) 30 | 32 | @Html.DisplayFor(modelItem => item.Price) 33 | 35 | Edit | 36 | Details | 37 | Delete 38 |
43 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Specialtys/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.EntityFrameworkCore; 9 | using SM.Website.Data; 10 | using SM.Website.Data.Entities; 11 | 12 | namespace SM.Website.Pages.Specialtys 13 | { 14 | [Authorize] 15 | public class IndexModel : PageModel 16 | { 17 | private readonly SM.Website.Data.ApplicationDbContext _context; 18 | 19 | public IndexModel(SM.Website.Data.ApplicationDbContext context) 20 | { 21 | _context = context; 22 | } 23 | 24 | public IList Specialty { get;set; } 25 | 26 | public async Task OnGetAsync() 27 | { 28 | Specialty = await _context.Specialtys.ToListAsync(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Students/Create.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.AspNetCore.Mvc.Rendering; 5 | using Microsoft.EntityFrameworkCore; 6 | using SM.Website.Data.Entities; 7 | using System.Threading.Tasks; 8 | 9 | namespace SM.Website.Pages.Students 10 | { 11 | [Authorize] 12 | public class CreateModel : PageModel 13 | { 14 | private readonly SM.Website.Data.ApplicationDbContext _context; 15 | 16 | public CreateModel(SM.Website.Data.ApplicationDbContext context) 17 | { 18 | _context = context; 19 | } 20 | 21 | public async Task OnGetAsync() 22 | { 23 | Specialtys = new SelectList(await _context.Specialtys.ToListAsync(), "Id", "Name"); 24 | return Page(); 25 | } 26 | 27 | [BindProperty] 28 | public Student Student { get; set; } 29 | public SelectList Specialtys { get; set; } 30 | 31 | public async Task OnPostAsync() 32 | { 33 | if (!ModelState.IsValid) 34 | { 35 | return Page(); 36 | } 37 | 38 | _context.Students.Add(Student); 39 | await _context.SaveChangesAsync(); 40 | 41 | return RedirectToPage("./Index"); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Students/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Students.DeleteModel 3 | 4 | @{ 5 | ViewData["Title"] = "Delete"; 6 | } 7 | 8 |

Delete

9 | 10 |

Are you sure you want to delete this?

11 |
12 |

Student

13 |
14 |
15 |
16 | @Html.DisplayNameFor(model => model.Student.FirstName) 17 |
18 |
19 | @Html.DisplayFor(model => model.Student.FirstName) 20 |
21 |
22 | @Html.DisplayNameFor(model => model.Student.LastName) 23 |
24 |
25 | @Html.DisplayFor(model => model.Student.LastName) 26 |
27 |
28 | @Html.DisplayNameFor(model => model.Student.FacultyNumber) 29 |
30 |
31 | @Html.DisplayFor(model => model.Student.FacultyNumber) 32 |
33 |
34 | 35 |
36 | 37 | | 38 | Back to List 39 |
40 |
41 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Students/Delete.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using SM.Website.Data.Entities; 6 | using System.Threading.Tasks; 7 | 8 | namespace SM.Website.Pages.Students 9 | { 10 | [Authorize] 11 | public class DeleteModel : PageModel 12 | { 13 | private readonly SM.Website.Data.ApplicationDbContext _context; 14 | 15 | public DeleteModel(SM.Website.Data.ApplicationDbContext context) 16 | { 17 | _context = context; 18 | } 19 | 20 | [BindProperty] 21 | public Student Student { get; set; } 22 | 23 | public async Task OnGetAsync(int? id) 24 | { 25 | if (id == null) 26 | { 27 | return NotFound(); 28 | } 29 | 30 | Student = await _context.Students.FirstOrDefaultAsync(m => m.Id == id); 31 | 32 | if (Student == null) 33 | { 34 | return NotFound(); 35 | } 36 | return Page(); 37 | } 38 | 39 | public async Task OnPostAsync(int? id) 40 | { 41 | if (id == null) 42 | { 43 | return NotFound(); 44 | } 45 | 46 | Student = await _context.Students.FindAsync(id); 47 | 48 | if (Student != null) 49 | { 50 | _context.Students.Remove(Student); 51 | await _context.SaveChangesAsync(); 52 | } 53 | 54 | return RedirectToPage("./Index"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Students/Details.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SM.Website.Pages.Students.DetailsModel 3 | 4 | @{ 5 | ViewData["Title"] = "Details"; 6 | } 7 | 8 |

Details

9 | 10 |
11 |

Student

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Student.FirstName) 16 |
17 |
18 | @Html.DisplayFor(model => model.Student.FirstName) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Student.LastName) 22 |
23 |
24 | @Html.DisplayFor(model => model.Student.LastName) 25 |
26 |
27 | @Html.DisplayNameFor(model => model.Student.FacultyNumber) 28 |
29 |
30 | @Html.DisplayFor(model => model.Student.FacultyNumber) 31 |
32 |
33 |
34 |
35 | Edit | 36 | Back to List 37 |
38 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Students/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.EntityFrameworkCore; 9 | using SM.Website.Data; 10 | using SM.Website.Data.Entities; 11 | 12 | namespace SM.Website.Pages.Students 13 | { 14 | [Authorize] 15 | public class DetailsModel : PageModel 16 | { 17 | private readonly SM.Website.Data.ApplicationDbContext _context; 18 | 19 | public DetailsModel(SM.Website.Data.ApplicationDbContext context) 20 | { 21 | _context = context; 22 | } 23 | 24 | public Student Student { get; set; } 25 | 26 | public async Task OnGetAsync(int? id) 27 | { 28 | if (id == null) 29 | { 30 | return NotFound(); 31 | } 32 | 33 | Student = await _context.Students.FirstOrDefaultAsync(m => m.Id == id); 34 | 35 | if (Student == null) 36 | { 37 | return NotFound(); 38 | } 39 | return Page(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/Students/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | using Microsoft.AspNetCore.Mvc.Rendering; 3 | using Microsoft.EntityFrameworkCore; 4 | using SM.Website.Data.Entities; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace SM.Website.Pages.Students 11 | { 12 | public class IndexModel : PageModel 13 | { 14 | private readonly SM.Website.Data.ApplicationDbContext _context; 15 | 16 | public IndexModel(SM.Website.Data.ApplicationDbContext context) 17 | { 18 | _context = context; 19 | } 20 | 21 | public IList Student { get;set; } 22 | public string StudentName { get; set; } 23 | public SelectList Specialties { get; set; } 24 | public string StudentSpecialty { get; set; } 25 | 26 | public async Task OnGetAsync(string studentName, int? studentSpecialty) 27 | { 28 | var students = from s in _context.Students select s; 29 | 30 | if (!String.IsNullOrEmpty(studentName)) 31 | students = students.Where(s => s.FirstName.Contains(studentName)); 32 | 33 | if (studentSpecialty.HasValue) 34 | students = students.Where(s => s.SpecialtyId == studentSpecialty.Value); 35 | 36 | Student = await students.Include(x => x.Specialty).ToListAsync(); 37 | StudentName = studentName; 38 | Specialties = new SelectList(await _context.Specialtys.ToListAsync(), "Id", "Name"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using SM.Website 3 | @using SM.Website.Data 4 | @namespace SM.Website.Pages 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 6 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace SM.Website 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/SM.Website.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | aspnet-SM.Website-E687DBB8-C986-47BC-A3DC-4F390F95C789 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-SM.Website-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Warning" 8 | } 9 | }, 10 | "AllowedHosts": "*" 11 | } 12 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/StudentManagement/SM.Website/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/StudentManagement/SM.Website/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "https://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jquery-validation/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.17.0", 31 | "_release": "1.17.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.17.0", 35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772" 36 | }, 37 | "_source": "https://github.com/jzaefferer/jquery-validation.git", 38 | "_target": "^1.17.0", 39 | "_originalSource": "jquery-validation", 40 | "_direct": true 41 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /examples/StudentManagement/SM.Website/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /examples/StudentManagement/StudentManagement.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28306.52 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SM.Website", "SM.Website\SM.Website.csproj", "{6CBB7872-9136-4F27-8690-6DC56A1C4BD4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6CBB7872-9136-4F27-8690-6DC56A1C4BD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6CBB7872-9136-4F27-8690-6DC56A1C4BD4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6CBB7872-9136-4F27-8690-6DC56A1C4BD4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6CBB7872-9136-4F27-8690-6DC56A1C4BD4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {53DAF993-B215-4C70-AC3C-5DB3C54DC492} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28922.388 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToDoOperations", "ToDoOperations\ToDoOperations.csproj", "{DE336B47-6C60-4D42-AD5B-6414F642391B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DE336B47-6C60-4D42-AD5B-6414F642391B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DE336B47-6C60-4D42-AD5B-6414F642391B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DE336B47-6C60-4D42-AD5B-6414F642391B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DE336B47-6C60-4D42-AD5B-6414F642391B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1F8E52B3-54E6-4211-B137-4BEBF29AFB5C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/CreateToDoItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ToDoOperations 4 | { 5 | public class CreateToDoItem 6 | { 7 | [JsonProperty(PropertyName = "description")] 8 | public string Description { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/DocByIdFromRouteData.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace ToDoOperations 8 | { 9 | public static class DocByIdFromRouteData 10 | { 11 | [FunctionName("DocByIdFromQueryString")] 12 | public static IActionResult Run( 13 | [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "items/{id}")] 14 | HttpRequest req, 15 | [CosmosDB( 16 | databaseName: "ToDoItems", 17 | collectionName: "Items", 18 | ConnectionStringSetting = "CosmosDBConnection", 19 | Id = "{id}", PartitionKey = "{id}")] ToDoItem toDoItem, 20 | ILogger log) 21 | { 22 | log.LogInformation("C# HTTP trigger function processed a request."); 23 | 24 | if (toDoItem == null) 25 | { 26 | log.LogInformation($"ToDo item not found"); 27 | } 28 | else 29 | { 30 | log.LogInformation($"Found ToDo item, Description={toDoItem.Description}"); 31 | } 32 | return new OkObjectResult(toDoItem); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/DocCreateToDoItem.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Extensions.Logging; 6 | using Newtonsoft.Json; 7 | using System.IO; 8 | using System.Threading.Tasks; 9 | 10 | namespace ToDoOperations 11 | { 12 | public static class DocCreateToDoItem 13 | { 14 | [FunctionName("DocCreateToDoItem")] 15 | public static async Task Run( 16 | [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "items")]HttpRequest req, 17 | [CosmosDB( 18 | databaseName: "ToDoItems", 19 | collectionName: "Items", 20 | ConnectionStringSetting = "CosmosDBConnection")] 21 | IAsyncCollector todos, 22 | ILogger log) 23 | { 24 | log.LogInformation("Creating a new todo list item"); 25 | string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); 26 | var input = JsonConvert.DeserializeObject(requestBody); 27 | 28 | var todo = new ToDoItem() { Description = input.Description }; 29 | //the object we need to add has to have a lower case id property or we'll 30 | // end up with a cosmosdb document with two properties - id (autogenerated) and Id 31 | await todos.AddAsync(new ToDoItem { Id = todo.Id, CreatedOn = todo.CreatedOn, IsCompleted = todo.IsCompleted, Description = todo.Description }); 32 | return new OkObjectResult(todo); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/DocDeleteToDoItem.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.Documents.Client; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Azure.WebJobs.Extensions.Http; 6 | using Microsoft.Extensions.Logging; 7 | using System; 8 | using System.Linq; 9 | using System.Threading.Tasks; 10 | 11 | namespace ToDoOperations 12 | { 13 | public static class DocDeleteToDoItem 14 | { 15 | [FunctionName("DocDeleteToDoItem")] 16 | public static async Task Run( 17 | [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = "items/{id}")]HttpRequest req, 18 | [CosmosDB(ConnectionStringSetting = "CosmosDBConnection")] DocumentClient client, 19 | ILogger log, string id) 20 | { 21 | Uri collectionUri = UriFactory.CreateDocumentCollectionUri("ToDoItems", "Items"); 22 | var document = client.CreateDocumentQuery(collectionUri).Where(t => t.Id == id) 23 | .AsEnumerable().FirstOrDefault(); 24 | if (document == null) 25 | { 26 | return new NotFoundResult(); 27 | } 28 | await client.DeleteDocumentAsync(document.SelfLink, options: new RequestOptions { PartitionKey = new Microsoft.Azure.Documents.PartitionKey(id) }); 29 | return new OkResult(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/DocUpdateToDoItem.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.Documents.Client; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Azure.WebJobs.Extensions.Http; 6 | using Microsoft.Extensions.Logging; 7 | using Newtonsoft.Json; 8 | using System; 9 | using System.IO; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | 13 | namespace ToDoOperations 14 | { 15 | public static class DocUpdateToDoItem 16 | { 17 | [FunctionName("DocUpdateToDoItem")] 18 | public static async Task Run( 19 | [HttpTrigger(AuthorizationLevel.Anonymous, "put", Route = "items/{id}")]HttpRequest req, 20 | [CosmosDB(ConnectionStringSetting = "CosmosDBConnection")] 21 | DocumentClient client, 22 | ILogger log, string id) 23 | { 24 | string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); 25 | var updated = JsonConvert.DeserializeObject(requestBody); 26 | Uri collectionUri = UriFactory.CreateDocumentCollectionUri("ToDoItems", "Items"); 27 | var document = client.CreateDocumentQuery(collectionUri).Where(t => t.Id == id).AsEnumerable().FirstOrDefault(); 28 | if (document == null) 29 | { 30 | return new NotFoundResult(); 31 | } 32 | 33 | document.SetPropertyValue("isCompleted", updated.IsCompleted); 34 | if (!string.IsNullOrEmpty(updated.Description)) 35 | { 36 | document.SetPropertyValue("description", updated.Description); 37 | } 38 | 39 | await client.ReplaceDocumentAsync(document, options: new RequestOptions { PartitionKey = new Microsoft.Azure.Documents.PartitionKey(id) }); 40 | 41 | // an easier way to deserialize a Document 42 | ToDoItem todo2 = (dynamic)document; 43 | 44 | return new OkObjectResult(todo2); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/DocsBySqlQuery.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Extensions.Logging; 6 | using System.Collections.Generic; 7 | 8 | namespace ToDoOperations 9 | { 10 | public static class DocsBySqlQuery 11 | { 12 | [FunctionName("DocsBySqlQuery")] 13 | public static IActionResult Run( 14 | [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "items")] 15 | HttpRequest req, 16 | [CosmosDB( 17 | databaseName: "ToDoItems", 18 | collectionName: "Items", 19 | ConnectionStringSetting = "CosmosDBConnection", 20 | SqlQuery = "SELECT top 2 * FROM c order by c._ts desc")] 21 | IEnumerable toDoItems, 22 | ILogger log) 23 | { 24 | log.LogInformation("C# HTTP trigger function processed a request."); 25 | foreach (ToDoItem toDoItem in toDoItems) 26 | { 27 | log.LogInformation(toDoItem.Description); 28 | } 29 | return new OkObjectResult(toDoItems); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/ToDoItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace ToDoOperations 5 | { 6 | public class ToDoItem 7 | { 8 | [JsonProperty(PropertyName = "id")] 9 | public string Id { get; set; } = Guid.NewGuid().ToString("n"); 10 | [JsonProperty(PropertyName = "createdOn")] 11 | public DateTime CreatedOn { get; set; } = DateTime.UtcNow; 12 | [JsonProperty(PropertyName = "description")] 13 | public string Description { get; set; } 14 | [JsonProperty(PropertyName = "isCompleted")] 15 | public bool IsCompleted { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/ToDoOperations.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net7.0 4 | v4 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | PreserveNewest 16 | Never 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/UpdateToDoItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace ToDoOperations 4 | { 5 | public class UpdateToDoItem 6 | { 7 | [JsonProperty(PropertyName = "description")] 8 | public string Description { get; set; } 9 | [JsonProperty(PropertyName = "isCompleted")] 10 | public bool IsCompleted { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/ToDoOperations/ToDoOperations/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31727.386 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseTrainingProject", "BaseTrainingProject\BaseTrainingProject.csproj", "{0ABF0E99-5292-482D-A2D5-389C183A3D03}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0ABF0E99-5292-482D-A2D5-389C183A3D03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0ABF0E99-5292-482D-A2D5-389C183A3D03}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0ABF0E99-5292-482D-A2D5-389C183A3D03}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0ABF0E99-5292-482D-A2D5-389C183A3D03}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {505122AE-9B8F-4775-BABE-C870AB948A0D} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/BaseTrainingProject.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BaseTrainingProject.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BaseTrainingProject.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/Calculator.razor: -------------------------------------------------------------------------------- 1 | 

Calculator

2 | 3 |

A = @A

4 |

B = @B

5 | 6 |

Aria = @Aria()

7 |

Perimeter = @Perimeter()

8 | 9 | @code { 10 | [Parameter] 11 | public double A { get; set; } 12 | [Parameter] 13 | public double B { get; set; } 14 | 15 | public double Aria() 16 | { 17 | return A * B; 18 | } 19 | 20 | public double Perimeter() 21 | { 22 | return A * 2 + B * 2; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model BaseTrainingProject.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using Microsoft.Extensions.Logging; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Diagnostics; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace BaseTrainingProject.Pages 11 | { 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 13 | [IgnoreAntiforgeryToken] 14 | public class ErrorModel : PageModel 15 | { 16 | public string RequestId { get; set; } 17 | 18 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 19 | 20 | private readonly ILogger _logger; 21 | 22 | public ErrorModel(ILogger logger) 23 | { 24 | _logger = logger; 25 | } 26 | 27 | public void OnGet() 28 | { 29 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | 3 | @using BaseTrainingProject.Data 4 | @inject WeatherForecastService ForecastService 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from a service.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/MyFirstRazorComponent.razor: -------------------------------------------------------------------------------- 1 | @page "/myfirstcomponent" 2 | 3 |

My First Razor Component

4 | 5 | 6 | 7 | @code { 8 | double a = 5; 9 | double b = 10; 10 | } 11 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/MySecondRazorComponent.razor: -------------------------------------------------------------------------------- 1 | @page "/my-second-component/{Counter:int}/{Name}" 2 | 3 |

My Second Razor Component

4 | 5 | @for (int i = 0; i < Counter; i++) 6 | { 7 |

Hello @Name

8 | } 9 | 10 | @code { 11 | [Parameter] 12 | public int Counter { get; set; } 13 | [Parameter] 14 | public string Name { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BaseTrainingProject.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | BaseTrainingProject 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | An error has occurred. This application may no longer respond until reloaded. 25 | 26 | 27 | An unhandled exception has occurred. See browser dev tools for details. 28 | 29 | Reload 30 | 🗙 31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace BaseTrainingProject 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | .main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .main > div { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 36 |
37 | 38 | @code { 39 | private bool collapseNavMenu = true; 40 | 41 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 42 | 43 | private void ToggleNavMenu() 44 | { 45 | collapseNavMenu = !collapseNavMenu; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 |  11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BaseTrainingProject 10 | @using BaseTrainingProject.Shared 11 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | .content { 18 | padding-top: 1.1rem; 19 | } 20 | 21 | .valid.modified:not([type=checkbox]) { 22 | outline: 1px solid #26b050; 23 | } 24 | 25 | .invalid { 26 | outline: 1px solid red; 27 | } 28 | 29 | .validation-message { 30 | color: red; 31 | } 32 | 33 | #blazor-error-ui { 34 | background: lightyellow; 35 | bottom: 0; 36 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 37 | display: none; 38 | left: 0; 39 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 40 | position: fixed; 41 | width: 100%; 42 | z-index: 1000; 43 | } 44 | 45 | #blazor-error-ui .dismiss { 46 | cursor: pointer; 47 | position: absolute; 48 | right: 0.75rem; 49 | top: 0.5rem; 50 | } 51 | -------------------------------------------------------------------------------- /exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/BaseTrainingProject/BaseTrainingProject/wwwroot/favicon.ico -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Sorry, there's nothing at this address.

9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Data/IWorkOutDataAccess.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using WOM.Models; 4 | 5 | namespace WOM.Client.Data 6 | { 7 | public interface IWorkOutDataAccess 8 | { 9 | Task AddAsync(WorkOut item); 10 | Task DeleteAsync(WorkOut item); 11 | Task> GetAsync(bool showAll, bool sortByCreatedOn, bool sortByCompletedOn); 12 | Task UpdateAsync(WorkOut item); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Data/WorkOutSimpleData.cs: -------------------------------------------------------------------------------- 1 | using Simple.OData.Client; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Net.Http; 6 | using System.Threading.Tasks; 7 | using WOM.Models; 8 | 9 | namespace WOM.Client.Data 10 | { 11 | public class WorkOutSimpleData : IWorkOutDataAccess 12 | { 13 | private readonly ODataClient _client; 14 | 15 | public WorkOutSimpleData(HttpClient client) 16 | { 17 | client.BaseAddress = new Uri("http://localhost:52949/odata"); 18 | ODataClientSettings settings = new(client); 19 | _client = new ODataClient(settings); 20 | } 21 | 22 | public async Task AddAsync(WorkOut item) 23 | { 24 | List results = []; 25 | ValidationContext validation = new(item); 26 | if (Validator.TryValidateObject(item, validation, results)) 27 | { 28 | return await _client.For().Set(item).InsertEntryAsync(); 29 | } 30 | else 31 | { 32 | throw new ValidationException(); 33 | } 34 | } 35 | 36 | public Task DeleteAsync(WorkOut item) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | 41 | public async Task> GetAsync(bool showAll, bool sortByCreatedOn, bool sortByCompletedOn) 42 | { 43 | return await _client.For().FindEntriesAsync(); 44 | } 45 | 46 | public Task UpdateAsync(WorkOut item) 47 | { 48 | throw new NotImplementedException(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

17 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Blazor WorkOut List

4 | 5 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace WOM.Client.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | WOM.Client 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | 12 | namespace WOM.Client 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Shared/WorkOutErrors.razor: -------------------------------------------------------------------------------- 1 | @foreach (var error in Errors) 2 | { 3 |
@error
4 | } 5 | 6 | @code { 7 | [Parameter] 8 | public List Errors { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Shared/WorkOutList.razor: -------------------------------------------------------------------------------- 1 | @using WOM.Models; 2 | @using WOM.Client.ViewModels; 3 | 4 | @inject WorkOutViewModel ViewModel; 5 | 6 |

WorkOut List

7 | 8 |

Enter new item:

9 | @if (ViewModel.ValidationErrors) 10 | { 11 | 12 | } 13 |
14 | 19 | 22 |
23 | 24 | @if (workOuts == null) 25 | { 26 |

LOADING.....

27 | } 28 | else 29 | { 30 | @foreach (var workOut in workOuts) 31 | { 32 |
33 | 34 | } 35 | } 36 | 37 | @code { 38 | public ElementReference InputBox; 39 | public List workOuts; 40 | 41 | protected override async Task OnInitializedAsync() 42 | { 43 | workOuts = (await ViewModel.WorkOutAsync()).ToList(); 44 | ViewModel.NewDescription = string.Empty; 45 | ViewModel.PropertyChanged += async (o, e) => 46 | { 47 | if (e.PropertyName.Equals(nameof(ViewModel.WorkOutAsync))) 48 | { 49 | workOuts = (await ViewModel.WorkOutAsync()).ToList(); 50 | } 51 | await InvokeAsync(() => 52 | { 53 | StateHasChanged(); 54 | }); 55 | }; 56 | 57 | await base.OnInitializedAsync(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/Shared/WorkOutShow.razor: -------------------------------------------------------------------------------- 1 | @using WOM.Models; 2 | 3 |
4 |   5 | @if (CurrentItem.Complete) 6 | { 7 | } 8 | else 9 | { 10 |

@CurrentItem.Description

11 | } 12 |

Created on: @CurrentItem.Created

13 |
14 | 15 | @code { 16 | [Parameter] 17 | public WorkOut CurrentItem { get; set; } 18 | } 19 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/WOM.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using WOM.Client 9 | @using WOM.Client.Shared 10 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Client/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/01/WorkOutManager/WOM.Client/wwwroot/favicon.ico -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Models/WOM.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Models/WorkOut.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace WOM.Models 5 | { 6 | public class WorkOut 7 | { 8 | public WorkOut() 9 | { 10 | Created = DateTime.UtcNow; 11 | } 12 | 13 | public int Id { get; set; } 14 | public bool Complete { get; set; } 15 | public DateTime Created { get; set; } 16 | public DateTime? MarkedComplete { get; set; } 17 | 18 | [Required(ErrorMessage = "Description is required.")] 19 | public string Description { get; set; } 20 | 21 | public void MarkComplete() 22 | { 23 | if (!Complete) 24 | { 25 | Complete = true; 26 | MarkedComplete = DateTime.UtcNow; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Server/Data/WorkOutContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using WOM.Models; 3 | 4 | namespace WOM.Server.Data 5 | { 6 | public class WorkOutContext : DbContext 7 | { 8 | public WorkOutContext(DbContextOptions options) : base(options) 9 | { } 10 | 11 | public DbSet WorkOutList { get; set; } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Server/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WOM.Server.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace WOM.Server 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Server/WOM.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Net9.0 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/01/WorkOutManager/WOM.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Sorry, there's nothing at this address.

9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Data/IWorkOutDataAccess.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using WOM.Models; 4 | 5 | namespace WOM.Client.Data 6 | { 7 | public interface IWorkOutDataAccess 8 | { 9 | Task AddAsync(WorkOut item); 10 | Task DeleteAsync(WorkOut item); 11 | Task> GetAsync(bool showAll, bool sortByCreatedOn, bool sortByCompletedOn); 12 | Task UpdateAsync(WorkOut item); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

17 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Blazor WorkOut List

4 | 5 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace WOM.Client.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | WOM.Client 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | 12 | namespace WOM.Client 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 16 |
17 | 18 | @code { 19 | private bool collapseNavMenu = true; 20 | 21 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 22 | 23 | private void ToggleNavMenu() 24 | { 25 | collapseNavMenu = !collapseNavMenu; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Shared/WorkOutErrors.razor: -------------------------------------------------------------------------------- 1 | @foreach (var error in Errors) 2 | { 3 |
@error
4 | } 5 | 6 | @code { 7 | [Parameter] 8 | public List Errors { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/Shared/WorkOutShow.razor: -------------------------------------------------------------------------------- 1 | @using WOM.Models; 2 | 3 |
4 |   5 | @if (CurrentItem.Complete) 6 | { 7 |

@CurrentItem.Description

8 |

Completed on: @CurrentItem.MarkedComplete

9 | } 10 | else 11 | { 12 | 13 |

@CurrentItem.Description

14 | } 15 |

Created on: @CurrentItem.Created

16 |
17 | 18 | @code { 19 | [Parameter] 20 | public WorkOut CurrentItem { get; set; } 21 | [Parameter] 22 | public Action Delete { get; set; } 23 | [Parameter] 24 | public Action MarkAsComplete { get; set; } 25 | } 26 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/WOM.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using WOM.Client 9 | @using WOM.Client.Shared 10 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/02/WorkOutManager/WOM.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Client/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/exercises/02/WorkOutManager/WOM.Client/wwwroot/favicon.ico -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Models/WOM.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Models/WorkOut.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace WOM.Models 5 | { 6 | public class WorkOut 7 | { 8 | public WorkOut() 9 | { 10 | Created = DateTime.UtcNow; 11 | } 12 | 13 | public int Id { get; set; } 14 | public bool Complete { get; set; } 15 | public DateTime Created { get; set; } 16 | public DateTime? MarkedComplete { get; set; } 17 | 18 | [Required(ErrorMessage = "Description is required.")] 19 | public string Description { get; set; } 20 | 21 | public void MarkComplete() 22 | { 23 | if (!Complete) 24 | { 25 | Complete = true; 26 | MarkedComplete = DateTime.UtcNow; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Server/Data/WorkOutContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using WOM.Models; 3 | 4 | namespace WOM.Server.Data 5 | { 6 | public class WorkOutContext : DbContext 7 | { 8 | public WorkOutContext(DbContextOptions options) : base(options) 9 | { } 10 | 11 | public DbSet WorkOutList { get; set; } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Server/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WOM.Server.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace WOM.Server 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Server/WOM.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Net9.0 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/02/WorkOutManager/WOM.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /exercises/README.md: -------------------------------------------------------------------------------- 1 | # Minimum requirements 2 | 3 | 4 | # 5 | ### Visual Studio 2022 6 | * .Net 6 - [link](https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral) 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Models/WOM.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Models/WorkOut.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace WOM.Models 5 | { 6 | public class WorkOut 7 | { 8 | public WorkOut() 9 | { 10 | Created = DateTime.UtcNow; 11 | } 12 | 13 | public int Id { get; set; } 14 | public bool Complete { get; set; } 15 | public DateTime Created { get; set; } 16 | public DateTime? MarkedComplete { get; set; } 17 | 18 | [Required(ErrorMessage = "Description is required.")] 19 | public string Description { get; set; } 20 | 21 | public void MarkComplete() 22 | { 23 | if (!Complete) 24 | { 25 | Complete = true; 26 | MarkedComplete = DateTime.UtcNow; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Server/Data/WorkOutContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using WOM.Models; 3 | 4 | namespace WOM.Server.Data 5 | { 6 | public class WorkOutContext : DbContext 7 | { 8 | public WorkOutContext(DbContextOptions options) : base(options) 9 | { } 10 | 11 | public DbSet WorkOutList { get; set; } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Server/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WOM.Server.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace WOM.Server 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Server/WOM.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WOM.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /exercises/StartingPoint/WorkOutManager/WorkOutManager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29424.173 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WOM.Models", "WOM.Models\WOM.Models.csproj", "{2E6D3F2C-D625-4FEE-B989-CF5644803CEC}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WOM.Server", "WOM.Server\WOM.Server.csproj", "{33E18F21-EE77-4735-AED8-BED426945760}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {2E6D3F2C-D625-4FEE-B989-CF5644803CEC}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {33E18F21-EE77-4735-AED8-BED426945760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {33E18F21-EE77-4735-AED8-BED426945760}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {33E18F21-EE77-4735-AED8-BED426945760}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {33E18F21-EE77-4735-AED8-BED426945760}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {0708D0D6-C8AF-43C2-A28F-7A8256DEC83D} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /presentations/Lecture-01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-01.pdf -------------------------------------------------------------------------------- /presentations/Lecture-02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-02.pdf -------------------------------------------------------------------------------- /presentations/Lecture-03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-03.pdf -------------------------------------------------------------------------------- /presentations/Lecture-04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-04.pdf -------------------------------------------------------------------------------- /presentations/Lecture-05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-05.pdf -------------------------------------------------------------------------------- /presentations/Lecture-06.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-06.pdf -------------------------------------------------------------------------------- /presentations/Lecture-07.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-07.pdf -------------------------------------------------------------------------------- /presentations/Lecture-08.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-08.pdf -------------------------------------------------------------------------------- /presentations/Lecture-09.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-09.pdf -------------------------------------------------------------------------------- /presentations/Lecture-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-10.pdf -------------------------------------------------------------------------------- /presentations/Lecture-11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-11.pdf -------------------------------------------------------------------------------- /presentations/Lecture-12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-12.pdf -------------------------------------------------------------------------------- /presentations/Lecture-13.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkyurkchiev/web-programming-biel/f4af5f3d61de2f3940909ffc2a0e34ac7736d679/presentations/Lecture-13.pdf --------------------------------------------------------------------------------