Skip to content
Permalink
af2f7b383e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
56 lines (50 sloc) 1.32 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using groupH_M32COM.Angular.DatabaseClasses;
using groupH_M32COM.Angular.DTO;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace groupH_M32COM.Angular.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class EventController : ControllerBase
{
private RCBoatRepository repo;
public EventController(RCBoatDBContext context)
{
this.repo = new RCBoatRepository(context);
}
// GET: api/Event
[Authorize]
[HttpGet]
public IEnumerable<EventsDTO> Get()
{
return this.repo.GetAllEventDTO().ToList();
}
// GET: api/Event/5
[HttpGet("{id}", Name = "Get")]
public EventsDTO Get(int id)
{
return this.repo.GetEventDTO(id);
}
// POST: api/Event
[HttpPost]
public void Post([FromBody] string value)
{
}
// PUT: api/Event/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value)
{
}
// DELETE: api/ApiWithActions/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}