コード例 #1
0
        public async Task <IActionResult> PutaddressModel(int id, addressModel addressModel)
        {
            if (id != addressModel.Id)
            {
                return(BadRequest());
            }

            _context.Entry(addressModel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!addressModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <ActionResult <addressModel> > PostaddressModel(addressModel addressModel)
        {
            _context.Address.Add(addressModel);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetaddressModel", new { id = addressModel.Id }, addressModel));
        }
コード例 #3
0
ファイル: wavesApi.cs プロジェクト: FieryTigra/test
        /// <summary>
        /// возврат адреса по псевдониму
        /// </summary>
        /// <param name="alias"></param>
        /// <returns></returns>
        public string getAddressAcountByAlias(string alias)
        {
            addressModel addressJson = new addressModel();

            using (var webClient = new WebClient())
            {
                addressJson = json.deserializeModel <addressModel>(webClient.DownloadString($"http://nodes.unblock.wavesnodes.com:6869/alias/by-alias/{alias}"));
            }
            //возвращаем профиль аккаунта
            return(addressJson.address);
        }