public IActionResult Create(DiamondCreateRequest request) { HttpClient httpclient = new HttpClient(); var result = httpclient.PostAsJsonAsync(uri, request).Result; return(RedirectToAction("Index")); }
public async Task<int> Create(DiamondCreateRequest request) { var diamond = new Diamond() { DiamondShape = request.DiamondShape, Price = request.Price }; _context.Diamonds.Add(diamond); await _context.SaveChangesAsync(); return diamond.Id; }
public async Task <IActionResult> CreateDiamond(DiamondCreateRequest request) { var tempId = await _diamondService.Create(request); return(Ok(tempId)); }