You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
697 B
C#

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();
}
}
}