public override void Dispose() { if (_growingFieldComingsRepository == null) { return; } _growingFieldComingsRepository.Dispose(); _growingFieldComingsRepository = null; if (_growingFruitComingsRepository == null) { return; } _growingFruitComingsRepository.Dispose(); _growingFruitComingsRepository = null; if (_growingFieldProfitsRepository == null) { return; } _growingFieldProfitsRepository.Dispose(); _growingFieldProfitsRepository = null; if (_growingFruitProfitsRepository == null) { return; } _growingFruitProfitsRepository.Dispose(); _growingFruitProfitsRepository = null; if (_growingTypeRepository == null) { return; } _growingTypeRepository.Dispose(); _growingTypeRepository = null; if (_growingCulturesRepository == null) { return; } _growingCulturesRepository.Dispose(); _growingCulturesRepository = null; if (_growingChargesRepository == null) { return; } _growingChargesRepository.Dispose(); _growingChargesRepository = null; if (_usersRepository == null) { return; } _usersRepository.Dispose(); _usersRepository = null; }
public GrowingController() { _growingFieldService = new GrowingService(new GrowingFieldComingsRepository(_context), new GrowingChargesRepository(_context), new UsersRepository(_context), new GrowingFieldProfitsRepository(_context), new GrowingTypeRepository(_context), new GrowingCulturesRepository(_context)); _growingFruitService = new GrowingService(new GrowingFruitComingsRepository(_context), new GrowingChargesRepository(_context), new UsersRepository(_context), new GrowingFruitProfitsRepository(_context), new GrowingTypeRepository(_context), new GrowingCulturesRepository(_context)); _growingCulturesRepository = new GrowingCulturesRepository(_context); _growingTypeRepository = new GrowingTypeRepository(_context); }
public GrowingService(IGrowingFruitComingsRepository growingFruitComingsRepository, IGrowingChargesRepository growingChargesRepository, IUsersRepository userRepository, IGrowingFruitProfitsRepository growingFruitProfitsRepository, IGrowingTypeRepository growingTypeRepository, IGrowingCulturesRepository growingCulturesRepository) { _growingFruitComingsRepository = growingFruitComingsRepository; _growingChargesRepository = growingChargesRepository; _growingFruitProfitsRepository = growingFruitProfitsRepository; _growingTypeRepository = growingTypeRepository; _growingCulturesRepository = growingCulturesRepository; _usersRepository = userRepository; }
public override void Dispose() { if (_growingFieldComingsRepository == null) return; _growingFieldComingsRepository.Dispose(); _growingFieldComingsRepository = null; if (_growingFruitComingsRepository == null) return; _growingFruitComingsRepository.Dispose(); _growingFruitComingsRepository = null; if (_growingFieldProfitsRepository == null) return; _growingFieldProfitsRepository.Dispose(); _growingFieldProfitsRepository = null; if (_growingFruitProfitsRepository == null) return; _growingFruitProfitsRepository.Dispose(); _growingFruitProfitsRepository = null; if (_growingTypeRepository == null) return; _growingTypeRepository.Dispose(); _growingTypeRepository = null; if (_growingCulturesRepository == null) return; _growingCulturesRepository.Dispose(); _growingCulturesRepository = null; if (_growingChargesRepository == null) return; _growingChargesRepository.Dispose(); _growingChargesRepository = null; if (_usersRepository == null) return; _usersRepository.Dispose(); _usersRepository = null; }