Lite upprensning bland kontroller och views, cutomers kan läggas till och uppdateras

This commit is contained in:
2019-01-22 22:21:05 +01:00
parent 00f1700aa6
commit 11b51493fe
16 changed files with 221 additions and 81 deletions

View File

@ -0,0 +1,32 @@
@model Vidly.ViewModels.MoviesViewModel
@{
ViewBag.Title = "Movies";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Movies</h2>
@if (Model.Movies.Count == 0)
{
<text>No one has rented this movie before.</text>
}
else
{
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Movie</th>
<th>Genre</th>
</tr>
</thead>
<tbody>
@foreach (var movie in Model.Movies)
{
<tr>
<td>@Html.ActionLink(@movie.Name,"Movies","Movies",new { id = movie.Id },null) </td>
<td>@movie.MovieGenre.Name</td>
</tr>
}
</tbody>
</table>
}