Beispiel #1
0
        public IActionResult Create(DiamondCreateRequest request)
        {
            HttpClient httpclient = new HttpClient();
            var        result     = httpclient.PostAsJsonAsync(uri, request).Result;

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 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));
        }