Init commit
This commit is contained in:
26
Controllers/GerbilsController.cs
Normal file
26
Controllers/GerbilsController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using GerbilManager.Models;
|
||||
using GerbilManager.Repositories;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace GerbilManager.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("gerbils")]
|
||||
public class GerbilsController : ControllerBase
|
||||
{
|
||||
private readonly InMemGerbilRepository repository;
|
||||
|
||||
public GerbilsController()
|
||||
{
|
||||
repository = new InMemGerbilRepository();
|
||||
}
|
||||
|
||||
//GET /gerbils
|
||||
[HttpGet]
|
||||
public IEnumerable<Gerbil> GetGerbils()
|
||||
{
|
||||
var items = repository.GetGerbils();
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user