Exemplo n.º 1
0
        public static void Initialize(IntroDbContext context)
        {
            context.Database.EnsureCreated();

            if (context.Expensess.Any())
            {
                return;
            }

            context.Expensess.AddRange(
                new Expenses
            {
                Description = "Titanic",
                Sum         = 17.20,
                Location    = "Cluj-Napoca",
                Date        = DateTime.Today,
                Currency    = "Lei",
                Type        = Type.Other
            },
                new Expenses
            {
                Description = "Apa",
                Sum         = 7.20,
                Location    = "Cluj-Napoca",
                Date        = DateTime.Today,
                Currency    = "Lei",
                Type        = Type.Food
            });
        }
Exemplo n.º 2
0
        public static void Initialize(IntroDbContext context)
        {
            context.Database.EnsureCreated();

            if (context.Expensess.Any())
            {
                return;
            }
        }