Exemplo n.º 1
0
 public AssecorTaskData(AssecorTaskDbContext dbContext,
                        IAsyncRepository <PersonEntity> persons,
                        IAsyncRepository <ColorEntity> colors)
 {
     this.dbContext = dbContext;
     Persons        = persons;
     Colors         = colors;
 }
Exemplo n.º 2
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.º 3
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();
        }
Exemplo n.º 4
0
 public EFRepository(AssecorTaskDbContext dbContext)
 {
     this.dbContext = dbContext;
 }