You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/IoTNode/Services/IoTNodeJob.cs

24 lines
614 B

using Application.Domain.Entities;
using Infrastructure.Data;
using System;
using System.Linq;
namespace IoTNode.Services
{
public class IoTNodeJob
{
private readonly IRepository<IoTTimer> _timerRepo;
public IoTNodeJob(IRepository<IoTTimer> timerRepo)
{
this._timerRepo = timerRepo;
}
public void TimerHanle(Guid id)
{
Console.WriteLine($"timer:{id} {DateTime.Now.ToLongTimeString()}");
var timer = this._timerRepo.ReadOnlyTable().FirstOrDefault(o => o.Id == id);
//call timer's command
}
}
}