Exemplo n.º 1
0
        private static void RemoveDepartment(SwabhavDBContext swabhavDBContext)
        {
            Department department = swabhavDBContext.Departments.Where((d) => d.Id == 2).Single();

            Console.WriteLine(department.DName);
            swabhavDBContext.Departments.Remove(department);
            swabhavDBContext.SaveChanges();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            SwabhavDBContext swabhavDBContext = new SwabhavDBContext();

            swabhavDBContext.Departments.Add(new Department {
                DName = "IT", Location = "SURAT"
            });
            swabhavDBContext.SaveChanges();
            //UpdateDepartment(swabhavDBContext);
            //RetrieveAllDepartments(swabhavDBContext);
        }