Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions Chapter_34/AutoLot.Web/Areas/Admin/Pages/Makes/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
namespace AutoLot.Web.Areas.Admin.Pages.Makes;

public class IndexModel : PageModel
public class IndexModel : BasePageModel<Make,IndexModel>
{
private readonly IAppLogging<IndexModel> _appLogging;
private readonly IMakeDataService _makeService;

[ViewData]
public string Title => "Makes";

public IndexModel(IAppLogging<IndexModel> appLogging, IMakeDataService carService)
public IndexModel(
IAppLogging<IndexModel> appLogging,
IMakeDataService makeService)
: base(appLogging, makeService, "Makes")
{
_appLogging = appLogging;
_makeService = carService;
}

public IEnumerable<Make> MakeRecords { get; set; }
public async Task OnGetAsync()
{
MakeRecords = await _makeService.GetAllAsync();
MakeRecords = await DataService.GetAllAsync();
}
}
}