Exemplo n.º 1
0
        public async Task <DonationPostFieldDTO> Edit(DonationPostFieldDTO dto)
        {
            var donationPostField = dto.MapTo <TDonationPostField>();
            await donationPostFieldRepository.Edit(donationPostField, Session);

            return(donationPostField.MapTo <DonationPostFieldDTO>());
        }
        public async Task <IActionResult> PutDonationPostField(DonationPostFieldDTO donationPostFieldDto)
        {
            var donationPostField = await donationPostFieldService.Edit(donationPostFieldDto);

            if (donationPostField == null)
            {
                return(BadRequest());
            }

            return(Ok(donationPostField));
        }
        public async Task <ActionResult <DonationPostFieldDTO> > PostDonationPostField(DonationPostFieldDTO donationPostFieldDto)
        {
            try
            {
                var donationPostField = await donationPostFieldService.Edit(donationPostFieldDto);

                return(Ok(donationPostField));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }