using FaKrosnoEfDataModel.Dtos; using FaKrosnoEfDataModel.Services; using Microsoft.AspNetCore.Mvc; namespace FaKrosnoApi.Controllers; [ApiController] [Route("api/[controller]")] public class ProductController(IProductService service) : Controller { [HttpGet] public async Task>> GetAll() { IEnumerable products = await service.GetEntities(); return Ok(products); } [HttpGet("by-index")] public async Task>> GetByIndex([FromQuery] string indexName) { IEnumerable products = await service.GetEntitiesToFix(indexName); return Ok(products); } [HttpPut] public async Task Update([FromBody] ProductDto product) { await service.UpdateEntity(product); return Ok(); } }