Beispiel #1
0
        public async Task <ActionResult> CompareTimeStamp([FromBody] TimestampParams pars)
        {
            try
            {
                if (pars == null)
                {
                    return(BadRequest("body must be given"));
                }
                int parLen = pars.pTextId.Length;


                var retVal = new int[parLen];

                var timeStamps = await _repo.GetVerseTimeStamps(pars.pTextId);

                for (int i = 0; i < parLen; i++)
                {
                    retVal[i] = pars.pTimeStamp[i].CompareTo(timeStamps[i]);
                }

                return(Ok(retVal));
            }
            catch (Exception ex)
            {
                _logger.LogError("Failure {0}", ex);
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Beispiel #2
0
        public async Task <IHttpActionResult> CompareTimeStamp([FromBody] TimestampParams pars)
        {
            if (pars == null)
            {
                return(BadRequest("pars cannot be null"));
            }
            int parLen = pars.pTextId.Length;


            var retVal = new int[parLen];
            var dcd    = await utils.InstanceDBAsync();

            {
                for (int i = 0; i < parLen; i++)
                {
                    retVal[i] = dcd.CompareTimeStamp(pars.pTextId[i], pars.pTimeStamp[i]);
                }
            }
            return(Ok(retVal));
        }