using Manarah.App.Services; using Manarah.Domain; using Microsoft.AspNetCore.Mvc; namespace Manarah.App.Controllers { public class ServersController : Controller { private readonly ServerService _serverService; public ServersController(ServerService serverService) { _serverService= serverService; } public async Task IndexAsync() { var serverList= await _serverService.GetServersAsync(); return View(serverList); } public IActionResult Add() { return View(); } [HttpPost] public IActionResult Add(Server server) { _serverService.AddServer(server); return RedirectToAction("index"); } } }