├── BlazorServerCleanArchitecture.WebUI
├── wwwroot
│ ├── favicon.png
│ └── css
│ │ └── site.css
├── Pages
│ ├── Index.razor
│ ├── Counter.razor
│ ├── Error.cshtml.cs
│ ├── FetchData.razor
│ ├── _Host.cshtml
│ ├── Stadiums.razor
│ └── Error.cshtml
├── appsettings.Development.json
├── appsettings.json
├── Data
│ ├── WeatherForecast.cs
│ └── WeatherForecastService.cs
├── BlazorServerCleanArchitecture.WebUI.csproj.user
├── _Imports.razor
├── App.razor
├── Shared
│ ├── MainLayout.razor
│ ├── SurveyPrompt.razor
│ ├── NavMenu.razor.css
│ ├── MainLayout.razor.css
│ └── NavMenu.razor
├── BlazorServerCleanArchitecture.WebUI.csproj
├── Properties
│ └── launchSettings.json
└── Program.cs
├── README.md
├── BlazorServerCleanArchitecture.Domain
├── Common
│ ├── Interfaces
│ │ ├── IEntity.cs
│ │ └── IAuditableEntity.cs
│ ├── BaseEntity.cs
│ └── BaseAuditableEntity.cs
├── BlazorServerCleanArchitecture.Domain.csproj
└── Entities
│ └── Stadium.cs
├── BlazorServerCleanArchitecture.Application
├── Common
│ └── Mappings
│ │ ├── IMapFrom.cs
│ │ └── MappingProfile.cs
├── Interfaces
│ └── Repositories
│ │ ├── IStadiumRepository.cs
│ │ ├── IGenericRepository.cs
│ │ └── IUnitOfWork.cs
├── Features
│ └── Stadiums
│ │ └── Queries
│ │ └── GetAllStadiums
│ │ ├── GetAllStadiumsDto.cs
│ │ └── GetAllStadiumsQuery.cs
├── Extensions
│ └── IServiceCollectionExtensions.cs
└── BlazorServerCleanArchitecture.Application.csproj
├── BlazorServerCleanArchitecture.Persistence
├── BlazorServerCleanArchitecture.Persistence.csproj
├── Repositories
│ ├── StadiumRepository.cs
│ ├── GenericRepository.cs
│ └── UnitOfWork.cs
├── Contexts
│ └── ApplicationDbContext.cs
└── Extensions
│ └── IServiceCollectionExtensions.cs
└── BlazorServerCleanArchitecture.sln
/BlazorServerCleanArchitecture.WebUI/wwwroot/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezzylearning/BlazorServerCleanArchitecture/HEAD/BlazorServerCleanArchitecture.WebUI/wwwroot/favicon.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BlazorServerCleanArchitecture
2 | Building Blazor Server Apps with Clean Architecture - Demo Project for a blog post available at https://www.ezzylearning.net/tutorial/building-blazor-server-apps-with-clean-architecture
3 |
--------------------------------------------------------------------------------
/BlazorServerCleanArchitecture.Domain/Common/Interfaces/IEntity.cs:
--------------------------------------------------------------------------------
1 | namespace BlazorServerCleanArchitecture.Domain.Common.Interfaces
2 | {
3 | public interface IEntity
4 | {
5 | public int Id { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/BlazorServerCleanArchitecture.WebUI/Pages/Index.razor:
--------------------------------------------------------------------------------
1 | @page "/"
2 |
3 |
Current count: @currentCount
8 | 9 | 10 | 11 | @code { 12 | private int currentCount = 0; 13 | 14 | private void IncrementCount() 15 | { 16 | currentCount++; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BlazorServerCleanArchitecture.WebUI/BlazorServerCleanArchitecture.WebUI.csproj.user: -------------------------------------------------------------------------------- 1 | 2 |Sorry, there's nothing at this address.
10 |This component demonstrates fetching data from a service.
10 | 11 | @if (forecasts == null) 12 | { 13 |Loading...
14 | } 15 | else 16 | { 17 || Date | 21 |Temp. (C) | 22 |Temp. (F) | 23 |Summary | 24 |
|---|---|---|---|
| @forecast.Date.ToShortDateString() | 31 |@forecast.TemperatureC | 32 |@forecast.TemperatureF | 33 |@forecast.Summary | 34 |
Loading...
13 | } 14 | else 15 | { 16 || Name | 20 |City | 21 |Capacity | 22 |Built Year | 23 |Pitch Length | 24 |Pitch Width | 25 |
|---|---|---|---|---|---|
| @stadium.Name | 32 |@stadium.City | 33 |@stadium.Capacity | 34 |@stadium.BuiltYear | 35 |@stadium.PitchLength | 36 |@stadium.PitchWidth | 37 |
24 | Request ID: @Model.RequestId
25 |
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 |