Ejemplo n.º 1
0
        public static ApplicationUser RandomPersonGet()
        {
            var randomPerson = new ApplicationUser();
            string[] firstNames = { "Jean", "Bobby", "Sydney", "Gordie", "Casie", "John", "Jane", "Dave", "Dan", "Serge", "Kevin", "Brad", "Wayne", "Roger", "Julie", "Janet", "", "Davie", "Rocket", "Frank", "Brad", "Marcel", "Boom Boom", "Andy", "Larry", "Pocket", "Jacques", "Steve", "Pete" };
            string[] lastNames = { "Beliveau", "Orr", "Crosby", "Howe", "Gretzky", "Campbell", "Beliveau", "Cornoyer", "Savard", "Smith", "Doe", "Black", "Brown", "Douglas", "McMurray", "Martin", "Richards", "Ward", "", "Keon", "Richard", "Mahovolich", "Park", "Dillon", "Dion", "Bathgate", "Robinson", "Lafleur", "Shutt" };
            string[] cities = { "Thunder Bay", "Ottawa", "Kingston", "London", "Nepean", "Red Lake", "Barrie", "Oshawa", "Niagra Falls", "Aylmer", "", "Gatineau", "Guelph", "Clinton" };
            string[] address1 = { "200 - 1821 Robson Street", "4175 Balkan Street", "9 Brook Lane", "3725 Main Street", "24 Sussex Drive", "153 Spadina Avenue", "13 Sydenham Street", "", "1200 Pennsylania Avenue", "42 Aldercrest Drive" };
            string[] dOb = { "3/11/1995", "9/10/1972", "6/12/1984", "7/11/1979", "12/9/1988", "12/4/2063", "4/9/2004", "5/9/1989" };
            string[] postalCode = { "V5V 3Z3", "M5W 1E6", "K1A 3M4", "M3J 4B3", "" };
            string[] provCode = { "BC", "ON", "MB", "FL", "NB", "NL" };
            var random = new Random();

            randomPerson.FirstName = firstNames[random.Next(0, firstNames.Length - 1)];
            randomPerson.LastName = lastNames[random.Next(0, firstNames.Length - 1)];
            randomPerson.City = cities[random.Next(0, cities.Length - 1)];
            randomPerson.Address1 = address1[random.Next(0, address1.Length - 1)];
            //randomPerson.EvePhone = "604-408-5703";
            //randomPerson.DayPhone = "604-639-4661";
            //randomPerson.MobPhone = "778-848-3118";
            randomPerson.PostalCode = postalCode[random.Next(0, postalCode.Length - 1)];
            //var strDob = dOb[random.Next(0, dOb.Length - 1)];
            //randomPerson.DateOfBirth = DateTime.Parse(strDob);
            //randomPerson.BirthDate = ConvertBirthDateToString(randomPerson.DateOfBirth);
            randomPerson.Email = random.Next(1, 1000000) + "@gmail.com";
            randomPerson.ProvCode = provCode[random.Next(0, provCode.Length - 1)];
            randomPerson.CountryCode = "CA";

            return randomPerson;
        }
Ejemplo n.º 2
0
 public static async Task<string> GenerateToken(ApplicationUser appUser, ApplicationUserManager userManager)
 {
     var provider = new DpapiDataProtectionProvider(appUser.Id);
     userManager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(provider.Create("EmailConfirmation"));
     string code = await userManager.GenerateEmailConfirmationTokenAsync(appUser.Id);
     return code;
 }