/// <summary> /// Constructor /// </summary> /// <param name="cacheRefreshTimeSpan"></param> /// <param name="basicCrud"></param> public MemoryCache(TimeSpan cacheRefreshTimeSpan, IBasicCrud basicCrud) { // Set the basic crud _basicCrud = basicCrud; var result = _basicCrud.GetAll().Result; // Initialize the data-store _dataStore = result.ToDictionary(x => x.Key, x => x.Value.Key); // Initialize the life times dictionary _lifeTimes = result.ToDictionary(x => x.Key, x => x.Value.Value); // Set the cache handler last ran _lastRun = DateTime.Now; // Cache refresher task _cacheRefresher = new Timer(e => DataStoreRefreshHandler(), null, cacheRefreshTimeSpan, cacheRefreshTimeSpan); }
/// <summary> /// Sets the basic-crud /// </summary> /// <param name="basicCrud"></param> /// <returns></returns> public IMemoryCacheBuilder SetPersistancy(IBasicCrud basicCrud) => Run(() => _basicCrud = basicCrud, this);
public StreamLogicImpl(IBasicCrud <Stream> streamDal, User user, Lazy <IStreamRipperManager> streamManager) { _streamDal = streamDal; _user = user; _streamManager = streamManager; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> /// <param name="streamRipperManager"></param> public StreamLogic(IEfRepository repository, Lazy <IStreamRipperManager> streamRipperManager) { _streamDal = repository.For <Stream>(); _streamRipperManager = streamRipperManager; }
public FtpSinkLogicImpl(IBasicCrud <FtpSink> ftpSinkDal, User user) { _ftpSinkDal = ftpSinkDal; _user = user; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> public FtpSinkLogic(IEfRepository repository) { _ftpSinkDal = repository.For <FtpSink>(); }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> /// <param name="globalConfigs"></param> public StudentLogic(IEfRepository repository, GlobalConfigs globalConfigs) { _studentDal = repository.For <Student>(); _globalConfigs = globalConfigs; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> /// <param name="globalConfigs"></param> public DriverLogic(IEfRepository repository, GlobalConfigs globalConfigs) { _driverDal = repository.For <Driver>(); _globalConfigs = globalConfigs; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> /// <param name="userManager"></param> public UserLogic(IEfRepository repository, UserManager <User> userManager) { _userDal = repository.For <User>(); _userManager = userManager; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> /// <param name="studentLogic"></param> /// <param name="globalConfigs"></param> public EventLogic(IEfRepository repository, IStudentLogic studentLogic, GlobalConfigs globalConfigs) { _eventDal = repository.For <Event>(); _studentLogic = studentLogic; _globalConfigs = globalConfigs; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> /// <param name="globalConfigs"></param> public HostLogic(IEfRepository repository, GlobalConfigs globalConfigs) { _hostDal = repository.For <Host>(); _globalConfigs = globalConfigs; }
/// <summary> /// Constructor dependency injection /// </summary> /// <param name="repository"></param> public UserLogic(IEfRepository repository) { _userDal = repository.For <User>(); }