Example #1
0
        public IHttpActionResult PostBeneficiary(Beneficiary beneficiary)
        {
            var beneficiarylist = db.fetch_beneficiaries(beneficiary.account_no);

            return(Ok(beneficiarylist));
            //if (!ModelState.IsValid)
            //{
            //    return BadRequest(ModelState);
            //}

            //db.Beneficiaries.Add(beneficiary);

            //try
            //{
            //    db.SaveChanges();
            //}
            //catch (DbUpdateException)
            //{
            //    if (BeneficiaryExists(beneficiary.ben_id))
            //    {
            //        return Conflict();
            //    }
            //    else
            //    {
            //        throw;
            //    }
            //}

            //return CreatedAtRoute("DefaultApi", new { id = beneficiary.ben_id }, beneficiary);
        }