Beispiel #1
0
        private void registerInMemoryStore(Funq.Container container)
        {
            // used for mocking database from dictionaries - need single "source" of each data type
            data = new InMemoryData();
            // register our data instance
            container.Register<InMemoryData>(data);
            container.Register<Dictionary<int, DueDate>>(data.DueDateData);

            // register repositories and autowire their dependencies
            container.RegisterAutoWiredAs<BaseMemoryRepository<DueDate>, IRepository<DueDate>>();
            container.RegisterAutoWiredAs<ProfileRepository, IProfileRepository>();
            container.RegisterAutoWiredAs<PredictionRepository, IPredictionRepository>();
            container.RegisterAutoWiredAs<CookieTrackerRepository, ICookieTrackerRepository>();
            container.RegisterAutoWiredAs<ResultsRepository, IResultsRepository>();

            container.RegisterAutoWiredAs<MemoryRepositories, MemoryRepositories>();
            container.RegisterAutoWiredAs<MemoryRepositories, IRepositories>();
        }
 public ResultsRepository(InMemoryData data)
 {
     this.data = data;
     d = data.PredictionData.Values.ToList();
 }