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()); }
public async Task <ActionResult <addressModel> > PostaddressModel(addressModel addressModel) { _context.Address.Add(addressModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetaddressModel", new { id = addressModel.Id }, addressModel)); }
/// <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); }