public static void PullAllEnvironments([Required][DefaultValue("1")] int daysbehind, [Optional]string pullfoldername) { var ph = new ProjectHandler().Initialize(); int daysBack = System.Math.Abs(daysbehind) * (-1); foreach (string salesForcePullEnvionment in ph.GetPullEnviroments()) { var ctx = ph.GetContext(salesForcePullEnvionment); if (ctx != null) { var resp = GetRepository(ph, salesForcePullEnvionment, pullfoldername); resp.SaveLocal(((fp, i) => fp.fullName.Contains("CP_") && fp.lastModifiedDate >= DateTime.Now.AddDays(daysBack)), CancellationToken.None); } } }
public void RunAllEnvironments() { var ph = new ProjectHandler().Initialize(); foreach (string salesForcePullEnvionment in ph.GetPullEnviroments()) { var ctx = ph.GetContext(salesForcePullEnvionment); if (ctx != null) { var resp = new SalesforceRepository(ctx, new DateTimeDirectoryStrategy()); resp.SaveLocal( ((fp, i) => fp.fullName.Contains("CP_") && fp.lastModifiedDate >= DateTime.Now.AddDays(-15)), CancellationToken.None); } } }