Exemple #1
0
        static void Insert()
        {
            Model_secondContainer ms = new Model_secondContainer();
            Employee1             e1 = new Employee1();

            e1.Name   = "Tejal";
            e1.Salary = 30000;
            ms.Employee1.Add(e1);
            ms.SaveChanges();
        }
Exemple #2
0
        static void Update(int id)
        {
            Model_secondContainer ms = new Model_secondContainer();
            Employee1             e1 = new Employee1();

            Employee1 em = ms.Employee1.Find(id);

            em.Name = "Prashant";

            ms.SaveChanges();
        }
Exemple #3
0
        static void Delete(int id)
        {
            Model_secondContainer ms = new Model_secondContainer();
            Employee1             e1 = new Employee1();

            Employee1 em = ms.Employee1.Find(id);

            ms.Employee1.Remove(em);


            ms.SaveChanges();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Model_secondContainer ms = new Model_secondContainer();
            var result = ms.Employee1.ToList();

            foreach (var a in result)
            {
                Console.WriteLine("{0} {1} ", a.Name, a.Salary);
            }


            Insert();
            Update(3);
            Delete(3);
            Console.ReadLine();
        }