public virtual void Update() { try { dbContext.SaveChanges(); dbContext = new MesajContext(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public virtual void Delete(T entity) { try { dbContext = dbContext ?? new MesajContext(); dbContext.Set <T>().Remove(entity); dbContext.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public virtual void Insert(T entity) { try { dbContext = dbContext ?? new MesajContext(); dbContext.Set <T>().Add(entity); dbContext.SaveChanges(); } catch (Exception ex) { dbContext = new MesajContext(); throw new Exception(ex.Message); } }
public Kisi LoginControl(string userName, string pass) { MesajContext db = new MesajContext(); return(db.Kisiler.Where(x => x.KullaniciAdi == userName && x.Sifre == pass).FirstOrDefault()); }
public T GetByID(ID id) { dbContext = new MesajContext(); return(dbContext.Set <T>().Find(id)); }
public List <T> GetALL() { dbContext = new MesajContext(); return(dbContext.Set <T>().ToList()); }