コード例 #1
0
        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());
        }
コード例 #2
0
        /// <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!");
            }
        }