20230201_145_upperpc/InSituLaboratory.Service/DeviceService.cs
2024-04-10 17:50:54 +08:00

37 lines
910 B
C#

using InSituLaboratory.Entities;
using InSituLaboratory.IService;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text;
using System.Threading.Tasks;
namespace InSituLaboratory.Service
{
public class DeviceService : BaseService, IDeviceSvice
{
public DeviceService(DbContext context) : base(context) { }
public IEnumerable<SysDevice> GetDevices()
{
return this.Set<SysDevice>();
}
public string GetDeviceByDeviceName(string DeviceName)
{
var workTime = "";
var sysDevice = this.Query<SysDevice>(m=> m.DeviceName == DeviceName).ToList();
foreach (var item in sysDevice)
{
workTime = item.WorkTime;
}
return workTime;
}
}
}