public async Task <EmployeeSalaryData> CreateEmployeeSalaryData(CreateEmployeeSalaryCommand createEmployeeSalaryCommand, ServerCallContext context) { _logger.LogInformation("Begin grpc call from method {Method} for Employee get create employee with salary {CreateEmployeeSalaryCommand}", context.Method, createEmployeeSalaryCommand); _logger.LogTrace( "----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})", createEmployeeSalaryCommand.GetGenericTypeName(), nameof(createEmployeeSalaryCommand.EmpId), createEmployeeSalaryCommand.EmpId, createEmployeeSalaryCommand); // var command = new CreateEmployeeSalaryCommand( createEmployeeSalaryCommand.EmpId); //var data; //=// await _mediator.Send(command); //if (data != null) //{ // context.Status = new Status(StatusCode.OK, $" Employee get net salary {createEmployeeSalaryCommand}"); // return this.MapResponse(data); //} //else { context.Status = new Status(StatusCode.NotFound, $" Employee get net salary {createEmployeeSalaryCommand} do not exist"); } return(new EmployeeSalaryData()); }
private CreateEmployeeSalaryCommand MapToEmployeeSalaryCommand(EmployeeData employeeData) { var command = new CreateEmployeeSalaryCommand { EmpId = employeeData.Emp_id }; return(command); }