public int DumpMongoStats(InterferenceMatrixStat stat) { stat.RecordTime = stat.RecordTime.Date; var existedStat = _repository.FirstOrDefault( x => x.ENodebId == stat.ENodebId && x.SectorId == stat.SectorId && x.DestPci == stat.DestPci && x.RecordTime == stat.RecordTime); if (existedStat == null) { _repository.Insert(stat); } return(_repository.SaveChanges()); }
public int DumpMongoStats(InterferenceMatrixStat stat) { stat.StatDate = stat.StatDate.Date; var cellId = stat.ENodebId + "-" + stat.SectorId; var existedStat = _repository.FirstOrDefault( x => x.CellId == cellId && x.NeighborPci == stat.NeighborPci && x.StatDate == stat.StatDate); if (existedStat == null) { _repository.Insert(stat); } else { existedStat.DestENodebId = stat.DestENodebId; existedStat.DestSectorId = stat.DestSectorId; } return(_repository.SaveChanges()); }
public async Task <int> UpdateNeighbors(int cellId, byte sectorId) { var count = 0; var neighborList = _neighborRepository.GetAllList(cellId, sectorId); foreach (var cell in neighborList) { count += await _repository.UpdateItemsAsync(cellId, sectorId, cell.Pci, cell.NearestCellId, cell.NearestSectorId); } return(_repository.SaveChanges() + count); }