public async Task <ActionResult <Beneficiaire> > PostBeneficiaire(Beneficiaire beneficiaire)
        {
            _context.beneficiaires.Add(beneficiaire);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBeneficiaire", new { id = beneficiaire.Id }, beneficiaire));
        }
        public async Task <IActionResult> PutBeneficiaire(int id, Beneficiaire beneficiaire)
        {
            if (id != beneficiaire.Id)
            {
                return(BadRequest());
            }

            _context.Entry(beneficiaire).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BeneficiaireExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }