Пример #1
0
 public virtual void Update()
 {
     try
     {
         dbContext.SaveChanges();
         dbContext = new MesajContext();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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());
        }
Пример #5
0
 public T GetByID(ID id)
 {
     dbContext = new MesajContext();
     return(dbContext.Set <T>().Find(id));
 }
Пример #6
0
 public List <T> GetALL()
 {
     dbContext = new MesajContext();
     return(dbContext.Set <T>().ToList());
 }