Ejemplo n.º 1
0
        public async Task <ActionResult> Create([Bind(Include = "Id,City,State,Zip")] Location location)
        {
            if (ModelState.IsValid)
            {
                db.Locations.Add(location);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(location));
        }
Ejemplo n.º 2
0
        public static void EnsureSeedData(this JobFinderContext JobFinderContext, IPasswordCryptoService passwordCryptoService)
        {
            var JobFinderUsers = JobFinderContext.Set <JobFinderUser>();

            if (!JobFinderUsers.AnyAsync(bu => bu.UserType == UserType.Admin).Result)
            {
                SeedUser("Admin", "Admin", "*****@*****.**", "admin1234", UserType.Admin, passwordCryptoService, JobFinderContext);
            }

            if (!JobFinderUsers.AnyAsync(bu => bu.UserType == UserType.Client).Result)
            {
                SeedUser("Clinet", "Client", "*****@*****.**", "client1234", UserType.Client, passwordCryptoService, JobFinderContext);
            }

            JobFinderContext.SaveChangesAsync();
        }