Lekkie zmiany

Trzeba dodać logowanie tak jak reszte(nie wiem gdzie było logowanie ale zaraz się znajdzie)
This commit is contained in:
Witkopawel
2025-04-30 16:21:51 +02:00
parent 071626366e
commit 0e14821cec
9 changed files with 131 additions and 161 deletions

View File

@@ -1,32 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using WebApp.Data;
using WebApp.Models;
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly ApplicationDbContext _context;
public HomeController(ILogger<HomeController> logger, ApplicationDbContext context)
{
_logger = logger;
_context = context;
}
public IActionResult Index()
{
var events = _context.Events.ToList(); // pobieranie danych z bazy
return View(events); // przekazanie do widoku
}
public IActionResult Privacy()
{
return View();
}
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}