Ejemplo n.º 1
0
        public async Task <IHttpActionResult> PutChallengeAsync([FromUri] int id, [FromBody] Models.DTO.Challenge challenge)
        {
            var updatedChallenge = await _storeChallengeService.UpdateChallengeAsync(id, (Models.EFDB.Challenge) challenge);

            if (updatedChallenge == null)
            {
                return(NotFound());
            }

            return(Ok((Models.DTO.Challenge)updatedChallenge));
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> PostChallengeAsync([FromBody] Models.DTO.Challenge challenge)
        {
            var inserted = await _storeChallengeService.InsertChallengeAsync((Models.EFDB.Challenge) challenge);

            return(Created(Url.Route("PostChallenge", null) + "/" + inserted.Id, inserted));
        }