Beispiel #1
0
        public bool MusteriSil(Musteri mstr)
        {
            //SET: DBset üzerinden işlem yapmak için tabloyu bu şekilde belirliyoruz
            //first: arama yaptıktan sonra dönen ilk değeri alır musteriye atar --firstordefault ta kullanılabilir
            Musteri musteri = sctx.Set <Musteri>().Where(m => m.Musteri_kod == mstr.Musteri_kod).First();

            sctx.Set <Musteri>().Remove(musteri);

            return(sctx.SaveChanges() > 0);
        }
 public void Commit()
 {
     if (_musteriContext != null)
     {
         _musteriContext.SaveChanges();
     }
     if (_aracContext != null)
     {
         _aracContext.SaveChanges();
     }
     if (_kiralamaContext != null)
     {
         _kiralamaContext.SaveChanges();
     }
     if (_puanContext != null)
     {
         _puanContext.SaveChanges();
     }
     if (_sirketContext != null)
     {
         _sirketContext.SaveChanges();
     }
     if (_talepContext != null)
     {
         _talepContext.SaveChanges();
     }
     if (_teslimContext != null)
     {
         _teslimContext.SaveChanges();
     }
 }
Beispiel #3
0
 public void Add(T entity)
 {
     _context.Entry(entity).State = EntityState.Added;
     _context.SaveChanges();
 }