Пример #1
0
        public PersistenceManager(bool longRunning = false)
        {
            var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);

            if (longRunning)
            {
                context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;
            }
            dataContext = context;
        }
Пример #2
0
        private static void CreateEmployee(string firstName, string lastName, string city, string country)
        {
            EmployeeEntity employee = new EmployeeEntity();

            employee.City         = city;
            employee.Country      = country;
            employee.FirstName    = firstName;
            employee.LastName     = lastName;
            employee.CreatedBy    = System.Environment.UserName;
            employee.ModifiedBy   = System.Environment.UserName;
            employee.CreatedDate  = DateTime.Now;
            employee.ModifiedDate = DateTime.Now;
            using (HiveDataContext hsDataContext = new HiveDataContext())
            {
                IEmployeeRepository empRepository = new EmployeeRepository(hsDataContext);
                empRepository.AddEmployee(employee);
                string message = empRepository.SaveChanges();
                Console.WriteLine(message);
            }
        }
Пример #3
0
 public EmployeeRepository(HiveDataContext hiveDataContext) : base(hiveDataContext)
 {
     HiveDataContext = hiveDataContext;
 }
Пример #4
0
 public ProductRepository(HiveDataContext hiveDataContext) : base(hiveDataContext)
 {
     HiveDataContext = hiveDataContext;
 }