Ejemplo n.º 1
0
        public IActionResult Create(GoldCreateRequest request)
        {
            HttpClient httpclient = new HttpClient();
            var        result     = httpclient.PostAsJsonAsync(uri, request).Result;

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public async Task <int> Create(GoldCreateRequest request)
        {
            var gold = new Gold()
            {
                GoldCarat = request.GoldCarat,
                Price     = request.Price
            };

            _context.Golds.Add(gold);
            await _context.SaveChangesAsync();

            return(gold.Id);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> CreateGold(GoldCreateRequest request)
        {
            var tempId = await _goldService.Create(request);

            return(Ok(tempId));
        }