public static Yonetici UpdateKullanici(Yonetici k)
 {
     using (YurtDbEntities db = new YurtDbEntities())
     {
         db.Entry(k).State = EntityState.Modified;
         db.Yonetici.Add(k);
         db.SaveChanges();
         return(k);
     }
 }
Esempio n. 2
0
        public static bool UpdateOgrenci(OgrenciModel ogrguncelle)
        {
            var yeniogrenci = ConvertToOgrenci(ogrguncelle);

            using (YurtDbEntities db = new YurtDbEntities())
            {
                db.Entry(yeniogrenci).State = EntityState.Modified;

                if (db.SaveChanges() > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }