diff --git a/projects/IoTCenter/Controllers/HomeController.cs b/projects/IoTCenter/Controllers/HomeController.cs index d487779a..168fcb7c 100644 --- a/projects/IoTCenter/Controllers/HomeController.cs +++ b/projects/IoTCenter/Controllers/HomeController.cs @@ -46,23 +46,23 @@ namespace IoTCenter.Controllers public IActionResult Index() { //this._eventPublisher.Publish(new EntityInsertedEvent(new Node())); - var temp = this._nodeRepo.Table().Include(o => o.Devices).ThenInclude(o => o.Data).FirstOrDefault(o => o.Name == "207"); - if (!temp.Devices.Any(o => o.Name == "207")) - { - temp.Devices.Add(new Device - { - Name = "²âÊÔÉ豸", - Number = "2019091602", - ProductId = this._productRepo.ReadOnlyTable().FirstOrDefault().Id, - Data = new List { - new Data{ - Key="Electricity", - Value="659", - } - } - }); - this._nodeRepo.SaveChanges(); - } + //var temp = this._nodeRepo.Table().Include(o => o.Devices).ThenInclude(o => o.Data).FirstOrDefault(o => o.Name == "207"); + //if (!temp.Devices.Any(o => o.Name == "207")) + //{ + // temp.Devices.Add(new Device + // { + // Name = "²âÊÔÉ豸", + // Number = "2019091602", + // ProductId = this._productRepo.ReadOnlyTable().FirstOrDefault().Id, + // Data = new List { + // new Data{ + // Key="Electricity", + // Value="659", + // } + // } + // }); + // this._nodeRepo.SaveChanges(); + //} return View(); }