123456789101112131415161718192021222324252627282930313233343536373839 |
- using Microsoft.AspNetCore.Mvc;
- using UnivateProperties_API.Model.Misc;
- using UnivateProperties_API.Repository.Misc;
-
- namespace UnivateProperties_API.Controllers.Misc
- {
- [Route("api/[controller]")]
- [ApiController]
- public class TCController : ControllerBase
- {
- private readonly ITCRepository _repo;
-
- public TCController(ITCRepository rp)
- {
- _repo = rp;
- }
- // GET: api/TC/5
- [HttpGet]
- public IActionResult Get()
- {
- return new OkObjectResult(_repo.GetTC());
- }
-
- // POST: api/TC
- [HttpPost]
- public IActionResult Post([FromBody] TC terms)
- {
- if (terms != null)
- {
- _repo.SetTC(terms);
- return Ok();
- }
- else
- {
- return new NoContentResult();
- }
- }
- }
- }
|