public override Task <UserQueryResponse> FindById(FindByIdLookup request, ServerCallContext context) { _logger.LogInformation($"Requesting user with ID: {request.Id} from the database"); var response = new UserQueryResponse(); //using (var conn = new SqlConnection(_connectionString)) //{ // conn.Open(); // _logger.LogDebug("Database connection open"); // using (var cmd = new SqlCommand("Select * From Web_Third_Parties WHERE Sequence = @Sequence", conn)) // { // cmd.CommandType = CommandType.Text; // cmd.Parameters.AddWithValue("@Sequence", request.Id); // using (var reader = cmd.ExecuteReader()) // { // while (reader.Read()) // { // user = SqlReaderToUserModel(reader); // } // } // } //} //_logger.LogInformation($"User with ID {user.Id} and email {user.Email} found, returning to gRPC client"); return(Task.FromResult(response)); }
public ApiContext() { baseUri = new Uri("https://reqres.in/api/"); response = new HttpResponseMessage(); user = new User(); userListResponse = new UserListResponse(); userQueryResponse = new UserQueryResponse(); loginToken = new LoginToken(); loginError = new LoginError(); }
public DonatorUserQueryResponse(UserQueryResponse userResponse, string name) { UserResponse = userResponse; Name = name; }