예제 #1
0
        public static IHelloWorld CreateInstance(HelloWorldClient client, string connectionString)
        {
            HelloWorldRepository repository = new HelloWorldRepository(connectionString);

            switch (client)
            {
            case HelloWorldClient.CONSOLE:
                return(new HelloWorldConsole(repository));

            case HelloWorldClient.WEB:
                return(new HelloWorldWeb(repository));

            case HelloWorldClient.MOBILE:
                return(new HelloWorldMobile(repository));

            case HelloWorldClient.WIN_SERVICE:
                return(new HelloWorldWinService(repository));

            default:
                throw new NotImplementedException(string.Format("Unknown Client : {0} ", client));
            }
        }
예제 #2
0
 public HelloWorldWeb(HelloWorldRepository repository)
     : base(repository, HelloWorldClient.WEB)
 {
 }
예제 #3
0
 public HelloWorldConsole(HelloWorldRepository repository)
     : base(repository, HelloWorldClient.CONSOLE)
 {
 }
예제 #4
0
 public HelloWorldBase(HelloWorldRepository repository, HelloWorldClient client)
 {
     this.client     = client;
     this.repository = repository;
 }
예제 #5
0
 public HelloWorldMobile(HelloWorldRepository repository)
     : base(repository, HelloWorldClient.MOBILE)
 {
 }
예제 #6
0
 public HelloWorldWinService(HelloWorldRepository repository)
     : base(repository, HelloWorldClient.WIN_SERVICE)
 {
 }