Пример #1
0
        static async Task GetEmployee(string culture)
        {
            using (FxRepository repository = new FxRepository(culture)) // using is used for disposing the context
            {
                EmployeeModel emp = await repository.GetEmployee();

                Console.ForegroundColor = ConsoleColor.Blue;
                Console.WriteLine();
                Console.WriteLine("Employee Name in default language: " + emp.Name);
                if (emp.Language != null)
                {
                    Console.WriteLine("Employee Name in chosen language: " + emp.Language.Name);
                }
            }
        }
Пример #2
0
        static async Task SaveEmployee(string culture)
        {
            using (FxRepository repository = new FxRepository(culture)) // using is used for disposing the context
            {
                EmployeeModel emp = await repository.GetEmployee();

                //emp.Description = DateTime.Now.ToLongTimeString();
                emp.Language.Name = DateTime.Now.ToShortTimeString();
                emp.Name          = emp.Language.Name;
                await repository.SaveEmployee(emp);

                Console.ForegroundColor = ConsoleColor.Blue;
                Console.WriteLine();
                Console.WriteLine("Employee updated");
            }
        }