Exemplo n.º 1
0
        static void SaveEmployee(int id, string name, IEmployeeDataSource dataSource)
        {
            EmployeeInfo info = dataSource.GetEmployee(id);

            info.Id   = id;
            info.Name = name;
            dataSource.SaveEmployee(info);
        }
 public void SaveEmployee(EmployeeInfo info)
 {
     Console.WriteLine("Save information about employee : ID = {0}, Name = {1} (cache)", info.Id, info.Name);
     _object.SaveEmployee(info);
     _proxyCache.AddOrUpdate(info.Id, info, (id, emp) => info);
 }