Ejemplo n.º 1
0
        public async Task <ActionResult <KalaRequest> > PostKalaRequest(KalaRequest kalaRequest)
        {
            _IKalaRequest.Add(kalaRequest);
            await _IKalaRequest.SaveAsync();

            return(CreatedAtAction("GetKalaRequest", new { id = kalaRequest.KalaRequestId }, kalaRequest));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutKalaRequest(int id, KalaRequest kalaRequest)
        {
            if (id != kalaRequest.KalaRequestId)
            {
                return(BadRequest());
            }

            _IKalaRequest.Update(kalaRequest);

            try
            {
                await _IKalaRequest.SaveAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!KalaRequestExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }