Exemplo n.º 1
0
        static void Main(string[] args)
        {
            context.Database.EnsureCreated();
            context.Database.Migrate();


            IRepository <Car> studentRepository = new EntityFrameworkRepository <Car>();

            studentRepository.Insert(
                new Car
            {
                Brand              = "Tesla",
                Model              = "ModelX",
                Engine             = 2.0,
                TypeOfCar          = "Electric",
                HorsePower         = 600,
                HasElectricWindows = true,
                HasNavigation      = true
            });

            AddCar();
            ReadCar();
            ChangeCar();
            DeleteCar();

            context.Dispose();
        }
        static void Main(string[] args)
        {
            context.Database.EnsureCreated();
            context.Database.Migrate();


            IRepository <Student> studentRepository = new EntityFrameworkRepository <Student>();

            studentRepository.Insert(
                new Student
            {
                LastName       = "Stamate",
                FirstMidName   = "Laurentiu",
                EnrollmentDate = DateTime.Parse("2021-09-01")
            });

            AddStudent();
            ReadStudent();
            ChangeStudent();
            DeleteStudent();

            context.Dispose();
        }