static void Main(string[] args) { ActiveDirectoryImportUserTask task = new ActiveDirectoryImportUserTask("INT"); task.Run(); //DataContext context = new DataContext(); //using (var transaction = context.Database.BeginTransaction()) //{ // Email email = new Email(); // email.FromAddress = "*****@*****.**"; // email.FromName = "CRA"; // email.Subject = "This is the test subject from CRA"; // email.Body = "This is the test body from CRA."; // email.EmailStatusTypeId = context.EmailStatusTypes.Where(p => p.Name == "Created").Single().EmailStatusTypeId; // context.Emails.Add(email); // context.SaveChanges(); // EmailTo to = new EmailTo(); // to.Email = email; // to.Name = "Vishant"; // to.Address = "*****@*****.**"; // context.EmailTos.Add(to); // context.SaveChanges(); // transaction.Commit(); //} Console.WriteLine("Press any key to continue."); Console.ReadKey(); }
public Task Execute(IJobExecutionContext context) { return(Task.Run(() => { ActiveDirectoryImportUserTask task = new ActiveDirectoryImportUserTask(ConfigurationManager.AppSettings["ActiveDirectoryImportUsersJobDomain"].ToString()); task.Run(); })); }