protected virtual void Dispose(bool disposing)
        {
            if (_objectDisposed)
            {
                return;
            }

            if (disposing)
            {
                Context.Dispose();
                Context = null;
            }

            _objectDisposed = true;
        }
        public BaseRepositoryFixture()
        {
            var directory = Directory.GetCurrentDirectory().Replace("bin\\Debug\\netcoreapp2.1", string.Empty);

            // get the configuration from the app settings
            var config = new ConfigurationBuilder()
                         .SetBasePath(directory)
                         .AddJsonFile("appsettings.json")
                         .Build();

            // define the database to use
            var optionsBuilder = new DbContextOptionsBuilder <PaylocityContext>();

            optionsBuilder.EnableSensitiveDataLogging();
            optionsBuilder.UseSqlServer(config.GetConnectionString("PaylocityConnection"));

            Context = new PaylocityContext(optionsBuilder.Options);
        }
예제 #3
0
 public EmployeeHelper(PaylocityContext context)
 {
     _context = context;
 }
예제 #4
0
 public DependentHelper(PaylocityContext context)
 {
     _context = context;
 }
 public EmployeeRepository(PaylocityContext context)
 {
     _context = context;
 }
 public DependentRepository(PaylocityContext context)
 {
     _context = context;
 }