Esempio n. 1
0
        private static void FindEmployee(InMemoryUnitOfWork inMemoryUnitOfWork)
        {
            var employee = inMemoryUnitOfWork.Employees.Single(e => e.Name == "Lenny");

            Console.WriteLine(employee.ToString());

            inMemoryUnitOfWork.Commit();
        }
Esempio n. 2
0
        private static void UpdateEmployee(InMemoryUnitOfWork inMemoryUnitOfWork)
        {
            var employee = inMemoryUnitOfWork.Employees.Single(e => e.Name == "Mr Burns");
            employee.Name = "Waylon Smithers";

            Console.WriteLine("Updated {0}", employee);

            inMemoryUnitOfWork.Commit();
        }
Esempio n. 3
0
        private static void RemoveEmployee(InMemoryUnitOfWork inMemoryUnitOfWork)
        {
            var employee = inMemoryUnitOfWork.Employees.Single(e => e.Name == "Lenny");
            inMemoryUnitOfWork.Employees.DeleteObject(employee);

            Console.WriteLine("Removed {0}", employee);

            inMemoryUnitOfWork.Commit();
        }
Esempio n. 4
0
        private static void AddEmployee(InMemoryUnitOfWork inMemoryUnitOfWork)
        {
            var employee = new Employee { Name = "Bart Simpson" };
            inMemoryUnitOfWork.Employees.AddObject(employee);

            Console.WriteLine("Added {0}", employee);

            inMemoryUnitOfWork.Commit();
        }