Generic Controller Test

This commit is contained in:
2018-10-12 20:52:59 +02:00
parent 39075051b2
commit e47c1ccb5e
12 changed files with 102 additions and 58 deletions

View File

@@ -11,32 +11,17 @@ namespace LaDOSE.Api.Controllers
{
[Produces("application/json")]
[Route("api/[controller]")]
public class EventController : Controller
public class EventController : GenericController<IEventService, Event>
{
private IEventService _eventService;
public EventController(IEventService eventService)
public EventController(IEventService service) : base(service)
{
_eventService = eventService;
}
[HttpPost]
public Event Post([FromBody]Event dto)
{
return _eventService.Create(dto);
}
[HttpGet("{id}")]
public Event Get(int id)
{
return _eventService.GetById(id);
}
[HttpGet("Generate/{eventId}/{wpEventId}")]
public bool GenerateChallonge(int eventId, int wpEventId)
{
return _eventService.CreateChallonge(eventId, wpEventId);
return _service.CreateChallonge(eventId, wpEventId);
}
}