public int AddOneMonitor(int cellId, byte sectorId) { var cell = _cellRepository.GetBySectorId(cellId, sectorId); if (cell == null) { return(0); } var item = _repository.GetTopPreciseMonitor(cell.Id); if (item != null) { return(0); } _repository.Insert(new InfrastructureInfo { InfrastructureId = cell.Id, HotspotType = HotspotType.TopPrecise }); return(_repository.SaveChanges()); }