Пример #1
0
        // Server side handler of the GetEmployeeName RPC
        public override Task <EmployeeName> GetEmployeeName(EmployeeNameRequest request, ServerCallContext context)
        {
            Console.WriteLine($"{nameof(AccountService)} | {nameof(GetEmployeeName)} | Request: {request.EmpId}");
            EmployeeData empData = new EmployeeData();

            return(Task.FromResult(empData.GetEmployeeName(request)));
        }
Пример #2
0
 public override Task <EmployeeName> GetEmployeeName(EmployeeNameRequest request, ServerCallContext context)
 {
     Console.CursorTop  = 3;
     Console.CursorLeft = 0;
     Console.WriteLine("Iteration count: {0,22:D8}", ++_invocationCounter);
     return(Task.FromResult(new EmployeeData().GetEmployeeName(request)));
 }
Пример #3
0
        public EmployeeName GetEmployeeName(EmployeeNameRequest request)
        {
            EmployeeName empName = new EmployeeName();

            switch (request.EmpId)
            {
            case "1":
                empName.FirstName = "John";
                empName.LastName  = "Doe";
                break;

            case "2":
                empName.FirstName = "Dave";
                empName.LastName  = "Williams";
                break;

            default:
                break;
            }
            return(empName);
        }
Пример #4
0
        public EmployeeName GetEmployeeName(EmployeeNameRequest request)
        {
            EmployeeName empName = new EmployeeName();

            switch (request.EmpId)
            {
            case "1":
                empName.FirstName = "Scott";
                empName.LastName  = "Gu";
                break;

            case "2":
                empName.FirstName = "Scott";
                empName.LastName  = "Hanselman";
                break;

            default:
                empName.FirstName = "Damien";
                empName.LastName  = "Edward";
                break;
            }
            return(empName);
        }
Пример #5
0
        // Server side handler of the GetEmployeeName RPC
        public override Task <EmployeeName> GetEmployeeName(EmployeeNameRequest request, ServerCallContext context)
        {
            EmployeeData empData = new EmployeeData();

            return(Task.FromResult(empData.GetEmployeeName(request)));
        }
Пример #6
0
 public override Task <EmployeeName> GetEmployeeName(EmployeeNameRequest request, ServerCallContext context)
 {
     return(Task.FromResult(new Data.EmployeeData().GetEmployeeName(request)));
 }