示例#1
0
 public List <Sirket> Get()
 {
     using (Core.DBHelper.DBContext dbContext = new Core.DBHelper.DBContext())
     {
         DbSet <Sirket> table = dbContext.Set <Sirket>();
         return(table.Include(x => x.Kullanici).Include(x => x.Arac).Include(x => x.İl).ToList());
     }
 }
示例#2
0
 public List <Arac> Get()
 {
     using (Core.DBHelper.DBContext dbContext = new Core.DBHelper.DBContext())
     {
         try
         {
             DbSet <Arac> table = dbContext.Set <Arac>();
             return(table.Include(x => x.Sirket).ToList());
         }
         catch (Exception ex)
         {
             throw new Exception(ex.Message);
         }
     }
 }
示例#3
0
 public void Delete(int id)
 {
     using (Core.DBHelper.DBContext dbContext = new Core.DBHelper.DBContext())
     {
         try
         {
             var SilinecekModel = dbContext.Set <Sirket>().FirstOrDefault(x => x.sirketID == id);
             dbContext.Set <Sirket>().Remove(SilinecekModel);
             dbContext.SaveChanges();
         }
         catch (Exception ex)
         {
             throw new Exception(ex.Message);
         }
     }
 }
示例#4
0
 public bool Add(Sirket model)
 {
     using (Core.DBHelper.DBContext dbContext = new Core.DBHelper.DBContext())
     {
         try
         {
             dbContext.Set <Sirket>().Add(model);
             dbContext.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             throw new Exception(ex.Message);
         }
     }
 }