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); } }
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); } } }