public async Task <int> UpdateHotSpotCells(CollegeCellNamesContainer container) { foreach (var cell in from cellName in container.CellNames select cellName.GetSplittedFields('-') into fields where fields.Length > 1 let bts = _btsRepository.GetByName(fields[0]) where bts != null select _cellRepository.GetBySectorId(bts.BtsId, fields[1].ConvertToByte(0)) into cell where cell != null select cell) { await _repository.InsertAsync(new HotSpotCdmaCellId { BtsId = cell.BtsId, SectorId = cell.SectorId, HotspotType = HotspotType.College, HotspotName = container.CollegeName }); } return(_repository.SaveChanges()); }
public async Task <int> Post(CollegeCellNamesContainer container) { return(await _service.UpdateHotSpotCells(container)); }
public async Task<int> UpdateCells(CollegeCellNamesContainer container) { foreach (var cell in from cellName in container.CellNames select cellName.GetSplittedFields('-') into fields where fields.Length > 1 let eNodeb = _eNodebRepository.GetByName(fields[0]) where eNodeb != null select _cellRepository.GetBySectorId(eNodeb.ENodebId, fields[1].ConvertToByte(0)) into cell where cell != null select cell) { await _repository.InsertCollegeCell(container.CollegeName, cell.Id); } return _repository.SaveChanges(); }
public async Task<int> Post(CollegeCellNamesContainer container) { return await _service.UpdateCells(container); }