Example #1
0
        public bool ModifyHospitalDetail(int id, HospitalDetails hospitalDetails)
        {
            using (MyWebApplicationContext db = new MyWebApplicationContext())
            {
                db.Entry(hospitalDetails).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                    return(true);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HospitalDetailsExists(id))
                    {
                        return(false);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }