Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class ServiceClient
  9.     {
  10.         public ServiceClient(string address, int port) { }
  11.         public IEnumerable<string>ProcessRequests( IEnumerable<string> next )
  12.         {
  13.             foreach (var req in next)
  14.             {
  15.                 yield return req + " Done";
  16.             }
  17.         }
  18.     }
  19.     class Program
  20.     {
  21.         static IEnumerable<string> GenerateRequest()
  22.         {
  23.             for (int i = 0; i < 20; i++)
  24.             {
  25.                 yield return string.Format( "get_user({0})", i );
  26.             }
  27.         }
  28.         static void Main(string[] args)
  29.         {
  30.             var client = new ServiceClient("", 0);
  31.             foreach (var s in client.ProcessRequests( GenerateRequest() ))
  32.             {
  33.                 System.Console.WriteLine(s);
  34.             }
  35.         }
  36.     }
  37. }
Add Comment
Please, Sign In to add comment