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

            return(RedirectToAction("Index"));
        }
Example #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;
 }
Example #3
0
        public async Task <IActionResult> CreateDiamond(DiamondCreateRequest request)
        {
            var tempId = await _diamondService.Create(request);

            return(Ok(tempId));
        }