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(); }
public bool RemoveOneCell(LteNeighborCell cell) { return(context.LteNeighborCells.Remove(cell) != null); }
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(); }
public void AddOneCell(LteNeighborCell cell) { context.LteNeighborCells.Add(cell); }