Esempio n. 1
0
        public static IPickRepository Create()
        {
            IPickRepository repo = null;

            //add descision logic here. Grab setting from file

            string repoType = ConfigurationManager.AppSettings["repoType"];

            //switch based on setting value
            switch (repoType)
            {
            case "memory":
                repo = new PickInMemoryRepo();
                break;

            case "file":
                repo = new PickRepository(Settings.FilePath);
                break;

            default:
                //select proper exception TODO
                throw new Exception("unexpected setting for repo type");

                //case "another repo"
            }

            //instantiate correct repo
            //return repo

            repo = new PickRepository(Settings.FilePath);

            return(repo);
        }
Esempio n. 2
0
 public PickService(IPickRepository pickRepository )
 {
     this._pickRepository = pickRepository;
 }
Esempio n. 3
0
 public PicksController(ICookieRepository cookieRepository, IPickRepository pickRepository, IConfiguration config) : base(cookieRepository, config)
 {
     _pickRepository = pickRepository;
 }
Esempio n. 4
0
 public AddPickWorkflow(IPickRepository concrete)
 {
     _creator = concrete;
 }
Esempio n. 5
0
 public LottoManager(IPickRepository repo)
 {
     _repo = repo;
 }
Esempio n. 6
0
 public Service(IPickRepository repo, IPickGetter pickGetter)
 {
     this.repo       = repo;
     this.pickGetter = pickGetter;
 }
Esempio n. 7
0
 public Controller(IPickRepository repo, IPickGetter pickGetter)
 {
     service = new Service(repo, pickGetter);
 }