public async Task <IHttpActionResult> Get(string term) { IEnumerable <Upw> records = null; if (IsEntKey(term)) { records = await _upwRepo.FindWithEntKey(term); if (RecordsFound(records)) { return(Ok(records)); } else { return(NotFound()); } } records = await _repo.FindByName(term); if (RecordsFound(records)) { return(Ok(records)); } return(NotFound()); }
/// <summary> /// Find Upw Record with entKey /// </summary> public async Task Find_Upw_Records_with_EntKey(string entKey) { // Arrange // Act var upwRecords = await _upwRepo.FindWithEntKey(entKey); if (upwRecords.Count() > 0) { foreach (var record in upwRecords) { Console.WriteLine("Records Found!.. {0}", record); Assert.IsTrue(upwRecords.Count() > 0, "Found at least 1 record"); } } else { Console.WriteLine("No Records found!"); } }