﻿@model IEnumerable<MvcDemo.Models.Album>

@{
    ViewBag.Title = "Index";
}

@if (TempData["Message"] != null) {
	<div class="alert alert-success">
		<strong>Created album</strong> 
		You successfully read created @TempData["Message"].ToString()
	</div>
}



<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Artist)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Artist)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.AlbumID }) |
            @Html.ActionLink("Details", "Details", new { id=item.AlbumID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.AlbumID })
        </td>
    </tr>
}

</table>
