Esempio n. 1
0
        public void Create(myData d)
        {
            Employee emp = new Employee();

            emp.Id    = d.id;
            emp.name  = d.name;
            emp.image = d.image;
            db.Employees.Add(emp);
            db.SaveChanges();
        }
Esempio n. 2
0
        public void update(myData x)
        {
            var data = db.Employees.Where(a => a.Id == x.id).Select(d => new myData {
                id = d.Id, name = d.name, image = d.image
            }).FirstOrDefault();

            data.name  = x.name;
            data.image = x.image;

            db.SaveChanges();
        }