Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

28 řádky
855 B

  1. using ModbusDemo.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace ModbusDemo.Uitls
  8. {
  9. public class DatabaseHelper
  10. {
  11. //private readonly ModbusDbContext _modbusDbContext;
  12. //public DatabaseHelper(ModbusDbContext modbusDbContext)
  13. //{
  14. // _modbusDbContext = modbusDbContext;
  15. //}
  16. //public static List<ModbusLog> GetOperateCoil()
  17. //{
  18. // return _modbusDbContext.ModbusLog
  19. // .Where(log => log.OperationType == "读线圈" || log.OperationType == "写线圈")
  20. // .OrderByDescending(log => log.Time) // 按时间倒序,最新的在前
  21. // .Take(30) // 只取前30条记录
  22. // .ToList(); // 执行查询
  23. //}
  24. }
  25. }