|
|
|
@ -1,21 +1,21 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using BowlingEF.Entities;
|
|
|
|
|
using BowlingLib.Model;
|
|
|
|
|
using BowlingService;
|
|
|
|
|
using BowlingService.Interfaces;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace BowlingApi.Controllers
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace BowlingApi.Controllers
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class PartieController : ControllerBase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class PartieController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ namespace BowlingApi.Controllers
|
|
|
|
|
|
|
|
|
|
// GET: api/Partie
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task< IActionResult >Get()
|
|
|
|
|
public async Task<IActionResult> Get()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -47,13 +47,13 @@ namespace BowlingApi.Controllers
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
//var result = _partieService.GetAll().Result;
|
|
|
|
|
//var result = _partieService.GetAll().Result;
|
|
|
|
|
//return Ok(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GET: api/Partie/djon
|
|
|
|
|
[HttpGet("{name}")]
|
|
|
|
|
public async Task < IActionResult> Get(string name)
|
|
|
|
|
public async Task<IActionResult> Get(string name)
|
|
|
|
|
{
|
|
|
|
|
// return Ok(_partieService.GetDataWithName(name));
|
|
|
|
|
|
|
|
|
@ -76,11 +76,11 @@ namespace BowlingApi.Controllers
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// POST: api/Partie
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult<PartieDTO>> Post([FromBody] PartieDTO parti)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// POST: api/Partie
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult<PartieDTO>> Post([FromBody] PartieDTO parti)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -99,12 +99,12 @@ namespace BowlingApi.Controllers
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PUT: api/Partie/5
|
|
|
|
|
[HttpPut("{id}")]
|
|
|
|
|
public async Task<ActionResult<PartieDTO>> Put(string name, [FromBody] PartieDTO partie)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PUT: api/Partie/5
|
|
|
|
|
[HttpPut("{id}")]
|
|
|
|
|
public async Task<ActionResult<PartieDTO>> Put(string name, [FromBody] PartieDTO partie)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -124,9 +124,10 @@ namespace BowlingApi.Controllers
|
|
|
|
|
StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|