Exemple #1
0
        public void Update(DemoTable fdata)
        {
            DemoTable data = new DemoTable();

            data         = db.DemoTables.FirstOrDefault(x => x.id == fdata.id);
            data.Name    = fdata.Name;
            data.Address = fdata.Address;
            db.SaveChanges();
        }
Exemple #2
0
 public void Delete(int Id = 0)
 {
     try
     {
         DemoTable data = new DemoTable();
         data = db.DemoTables.FirstOrDefault(x => x.id == Id);
         db.DemoTables.Remove(data);
         db.SaveChanges();
     }
     catch (Exception)
     {
     }
 }
Exemple #3
0
 public void Add(DemoTable fdata)
 {
     try
     {
         DemoTable data = new DemoTable();
         data.Name    = fdata.Name;
         data.Address = fdata.Address;
         db.DemoTables.Add(data);
         db.SaveChanges();
     }
     catch (Exception)
     {
     }
 }