35 public void Main(string input) { var repository = CreateRepository(input); var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
36 public void Main(string input) { var repository = CreateRepository(input); var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
37 public void Main(string input) { var repository = CreateRepository(input); var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
38 public void Main(string input) { var repository = CreateRepository(input); var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }
39 public void Main(string input) { var repository = CreateRepository(input); var proposalSubmitService = new ProposalSubmitService(repository); var command = new ProposalSubmitCommand(); proposalSubmitService.Handle(command); } private IProposalRepository CreateRepository(string input) { switch (input) { case "local" : return new InMemoryProposalRepository(); case "production" : return new SqlProposalRepository(); default: throw new ArgumentOutOfRangeException(); } }