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); }
public PickService(IPickRepository pickRepository ) { this._pickRepository = pickRepository; }
public PicksController(ICookieRepository cookieRepository, IPickRepository pickRepository, IConfiguration config) : base(cookieRepository, config) { _pickRepository = pickRepository; }
public AddPickWorkflow(IPickRepository concrete) { _creator = concrete; }
public LottoManager(IPickRepository repo) { _repo = repo; }
public Service(IPickRepository repo, IPickGetter pickGetter) { this.repo = repo; this.pickGetter = pickGetter; }
public Controller(IPickRepository repo, IPickGetter pickGetter) { service = new Service(repo, pickGetter); }