Example #1
0
        // POST api/Study
        public Hashtable Post([FromBody] dynamic value)
        {
            if (value == null)
            {
                return(null);
            }

            string sqlString = value.SQLString.Value;
            string checkSum  = value.Checksum.Value;

            Hashtable srcStudy  = _StudyService.GetStudy(sqlString);
            Hashtable destStudy = _entityConverterHelper.Convert(srcStudy, "Study");

            string computedChecksum = _checksumService.GenerateChecksum(destStudy);

            if (!string.Equals(checkSum, computedChecksum))
            {
                return(null);
            }

            return(destStudy);
        }
Example #2
0
        // POST api/checksum
        public Hashtable Post([FromBody] dynamic value)
        {
            if (value == null)
            {
                return(null);
            }

            Hashtable result = new Hashtable();

            string sqlString        = value.SQLString.Value;
            string sEntityType      = value.EntityType.Value;
            string sEthereumAddress = value.EthereumAddress.Value;

            Hashtable srcEntity  = _entityService.GetEntity(sqlString);
            Hashtable destEntity = _entityConverterHelper.Convert(srcEntity, sEntityType);

            string sChecksum = _checksumService.GenerateChecksum(destEntity);

            result.Add("Checksum", sChecksum);

            return(result);
        }