public void Save(IEnumerable <LteCellRelationCsv> infos)
 {
     foreach (LteCellRelationCsv info in infos)
     {
         string[] fields   = info.NeighborRelation.Split(':');
         int      eNodebId = fields[3].ConvertToInt(0);
         byte     sectorId = fields[4].ConvertToByte(0);
         if (eNodebId < 10000)
         {
             continue;
         }
         LteNeighborCell nCell = _repository.NeighborCells.FirstOrDefault(x =>
                                                                          x.CellId == info.ENodebId && x.SectorId == info.SectorId &&
                                                                          x.NearestCellId == eNodebId && x.NearestSectorId == sectorId);
         if (nCell != null)
         {
             continue;
         }
         nCell = new LteNeighborCell
         {
             CellId          = info.ENodebId,
             SectorId        = info.SectorId,
             NearestCellId   = eNodebId,
             NearestSectorId = sectorId
         };
         _repository.AddOneCell(nCell);
         if (eNodebId % 1000 == sectorId)
         {
             _repository.SaveChanges();
         }
     }
     _repository.SaveChanges();
 }
Пример #2
0
 public bool RemoveOneCell(LteNeighborCell cell)
 {
     return(context.LteNeighborCells.Remove(cell) != null);
 }
Пример #3
0
 public void Save(IEnumerable<LteCellRelationCsv> infos)
 {
     foreach (LteCellRelationCsv info in infos)
     {
         string[] fields = info.NeighborRelation.Split(':');
         int eNodebId = fields[3].ConvertToInt(0);
         byte sectorId = fields[4].ConvertToByte(0);
         if (eNodebId < 10000) continue;
         LteNeighborCell nCell = _repository.NeighborCells.FirstOrDefault(x =>
             x.CellId == info.ENodebId && x.SectorId == info.SectorId
             && x.NearestCellId == eNodebId && x.NearestSectorId == sectorId);
         if (nCell != null) continue;
         nCell = new LteNeighborCell
         {
             CellId = info.ENodebId,
             SectorId = info.SectorId,
             NearestCellId = eNodebId,
             NearestSectorId = sectorId
         };
         _repository.AddOneCell(nCell);
         if (eNodebId%1000 == sectorId)
         {
             _repository.SaveChanges();
         }
     }
     _repository.SaveChanges();
 }
Пример #4
0
 public void AddOneCell(LteNeighborCell cell)
 {
     context.LteNeighborCells.Add(cell);
 }