Basic Home functionality complete
|
@ -6,4 +6,8 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\images\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,7 +1,49 @@
|
|||
@page "/"
|
||||
@using Blazor_DotNet8_MovieApp.Models;
|
||||
@using Blazor_DotNet8_MovieApp.Services;
|
||||
|
||||
<PageTitle>Home</PageTitle>
|
||||
@inject IMovieReviewService MovieReviewService
|
||||
|
||||
<h1>Home</h1>
|
||||
<PageTitle>Movies in DotNet8</PageTitle>
|
||||
|
||||
Welcome to your new app.
|
||||
@if(Movies is null)
|
||||
{
|
||||
<h1>Loading Movies...</h1>
|
||||
}
|
||||
else
|
||||
{
|
||||
@for (int i = 0; i <= Movies.Count / 4; i++)
|
||||
{
|
||||
MovieModel[] movieGroup = Movies.Skip(i * 4).Take(4).ToArray();
|
||||
|
||||
<div class="row">
|
||||
|
||||
@foreach(MovieModel movie in movieGroup)
|
||||
{
|
||||
<div class="col-md-3 mb-2">
|
||||
<a href="/MovieReview/@movie?.Id">
|
||||
<img class="img-thumbnail" src="@movie?.ImageUrl">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
@movie?.Title
|
||||
</h5>
|
||||
<p class="card-text">
|
||||
@movie?.Description
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@code {
|
||||
List<MovieModel> Movies = null;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Movies = MovieReviewService?.GetMovies();
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 703 KiB |
After Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 1.9 MiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 2.5 MiB |
After Width: | Height: | Size: 693 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 2.3 MiB |
After Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 2.1 MiB |