32 lines
759 B
C#
32 lines
759 B
C#
|
using Aps_Single_Page_Anwendung.Models;
|
|||
|
using Aps_Single_Page_Anwendung.Repositories;
|
|||
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace Aps_Single_Page_Anwendung.Controllers
|
|||
|
{
|
|||
|
|
|||
|
// Routing für den Controller
|
|||
|
[ApiController]
|
|||
|
[Route("api/[controller]")]
|
|||
|
|
|||
|
// Muss von ControllerBase erben, sonst muss die Schnittstelle selbst implmentiert werden
|
|||
|
public class SpeisenController : ControllerBase
|
|||
|
{
|
|||
|
private readonly ISpeiseRepository _repository;
|
|||
|
|
|||
|
public SpeisenController(ISpeiseRepository repository)
|
|||
|
{
|
|||
|
_repository = repository;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet]
|
|||
|
// Muss etwas zurück geben
|
|||
|
public IEnumerable<Speise> Get()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|