예제 #1
0
        private static void SeedUsers(AzureGalleryContext context)
        {
            string seedGendersPath = Path.Combine(SeedPath, "users.json");

            if (File.Exists(seedGendersPath))
            {
                context.Users.AddRange(JsonConvert.DeserializeObject <List <User> >(File.ReadAllText(seedGendersPath)));
            }
        }
예제 #2
0
        public static void SeedData(this AzureGalleryContext context)
        {
            SeedUsers(context);

            context.SaveChanges();
        }