Beispiel #1
0
 public static List <Entities.Kullanici> List()
 {
     using (var c = new TanerDbContext())
     {
         return(c.DbKullanicilar.ToList());
     }
 }
Beispiel #2
0
 public static void Add(Entities.Kullanici kullanici)
 {
     using (var c = new TanerDbContext())
     {
         c.DbKullanicilar.Add(kullanici);
         c.SaveChanges();
     }
 }
Beispiel #3
0
 public static void Delete(long id)
 {
     using (var c = new TanerDbContext())
     {
         var kullanici = c.DbKullanicilar.Find(id);
         c.Entry(kullanici).State = System.Data.Entity.EntityState.Deleted;
         c.SaveChanges();
     }
 }
Beispiel #4
0
 public static void Update(Entities.Kullanici kullanici)
 {
     using (var c = new TanerDbContext())
     {
         c.DbKullanicilar.Attach(kullanici);
         c.Entry(kullanici).State = System.Data.Entity.EntityState.Modified;
         c.SaveChanges();
     }
 }