Ejemplo n.º 1
0
        public IHttpActionResult PutProposal(ProposalDTO updatedProposal)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var proposal = Mapper.Map <Proposal>(updatedProposal);

            _proposalService.UpdateProposal(proposal);

            try
            {
                _proposalService.SaveProposal();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_proposalService.ProposalExists(proposal.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }