コード例 #1
0
        public void AddNewUserToDatabase()
        {
            var user = new UserEntity
            {
                FirstName = "Petter",
                LastName = "Petter",
                DateOfBirth = DateTime.Now
            };

            using (var db = new MuscleTherapyContext())
            {
                db.Users.Add(user);
                db.SaveChanges();
            }
        }
コード例 #2
0
        public void AddNewCustomerToDatabase()
        {
            var customer = new CustomerEntity
            {
                FirstName = "Petter",
                LastName = "Petter",
                BirthDay = DateTime.Now,
                CreatedDate = DateTime.Now

            };

            using (var db = new MuscleTherapyContext())
            {
                db.Customers.Add(customer);
                db.SaveChanges();
            }
        }