using HslCommunication; using Microsoft.AspNetCore.Mvc; using SlnMesnac.Repository.service; namespace SlnMesnac.Controllers { [Route("api/[controller]")] [ApiController] public class ValuesController : ControllerBase { private IBaseMaterialService _service; public ValuesController(IBaseMaterialService service) { _service = service; } [HttpGet] public string Test() { var result = _service.GetMaterialInfos().Result; Console.WriteLine("查询个数:"+result.Count); result = result.Take(5).ToList(); return result.ToJsonString(); } } }