Exemplo n.º 1
0
        public static void Initialize(AssecorTaskDbContext context)
        {
            if (context.Colors.Any())
            {
                return;
            }

            context.Colors.AddRange(new ColorEntity
            {
                Color = "blau",
            },
                                    new ColorEntity
            {
                Color = "rot",
            });

            context.SaveChanges();
        }
Exemplo n.º 2
0
        public static void Initialize(AssecorTaskDbContext context)
        {
            if (context.Colors.Any())
            {
                return;
            }

            for (int i = 0; i < Colors.Length; i++)
            {
                var color = new ColorEntity
                {
                    Color = Colors[i]
                };

                context.Colors.Add(color);
            }

            context.SaveChanges();
        }