public DuzenleYadaEkle(SiparisContext context) { db = context; InitializeComponent(); PizzalarıListele(); MalzemeleriListele(); }
public EFRepository(SiparisContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("dbContext can not be null."); } _dbContext = dbContext; _dbSet = dbContext.Set <T>(); }
public bool MusteriYenile(tblMusteri mstr) { using (SiparisContext ctx = new SiparisContext()) { tblMusteri m = ctx.tblMusteris.Find(mstr.MusteriId); m.Musteriad = mstr.Musteriad; m.Musterisoyad = mstr.Musterisoyad; m.Musteriadres = mstr.Musteriadres; m.Musterimail = mstr.Musterimail; m.Mustericep = mstr.Mustericep; ctx.SaveChanges(); } return(true); }
public UnitOfWork(SiparisContext dbContext) { Database.SetInitializer <SiparisContext>(null); if (dbContext == null) { throw new ArgumentNullException("dbContext null Olamaz."); } _dbContext = dbContext; //_dbContext.Configuration.LazyLoadingEnabled = false; //_dbContext.Configuration.ValidateOnSaveEnabled = false; //_dbContext.Configuration.ProxyCreationEnabled = false; }
public bool MusteriKayit(tblMusteri mstr) { using (SiparisContext ctx = new SiparisContext()) { ctx.tblMusteris.Add(new tblMusteri { Musteriad = mstr.Musteriad, Musterisoyad = mstr.Musterisoyad, Musteriadres = mstr.Musteriadres, Mustericep = mstr.Mustericep, Musterimail = mstr.Musterimail }); ctx.SaveChanges(); return(true); } }
private UserService() { _dbContext = new SiparisContext(); _uow = new UnitOfWork(_dbContext); _userRepository = Repository <Users> .GetInstance(_dbContext); }