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; }
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); } }
public EmployeeRepository(HiveDataContext hiveDataContext) : base(hiveDataContext) { HiveDataContext = hiveDataContext; }
public ProductRepository(HiveDataContext hiveDataContext) : base(hiveDataContext) { HiveDataContext = hiveDataContext; }