Skip to content

Commit 2d3f51e

Browse files
committed
code cleanup and comments fixing
1 parent e57f95e commit 2d3f51e

10 files changed

+35
-46
lines changed

BenchmarkTests/CacheCommandTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Net;
3-
using System.Text;
42
using BenchmarkDotNet.Attributes;
53
using Npgsql;
64
using NpgsqlRest;

BenchmarkTests/ConnectionParametersTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Net;
3-
using System.Text;
42
using BenchmarkDotNet.Attributes;
53
using Npgsql;
64

BenchmarkTests/FormatStringTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Net;
32
using System.Text;
43
using System.Text.RegularExpressions;
54
using BenchmarkDotNet.Attributes;

BenchmarkTests/HttpClientTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Net;
32
using System.Text;
43
using BenchmarkDotNet.Attributes;
54

BenchmarkTests/ParseStringsTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Net;
3-
using System.Text;
42
using System.Text.RegularExpressions;
53
using BenchmarkDotNet.Attributes;
64
using NpgsqlRest;

NpgsqlRest/Auth/AuthHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Net;
22
using System.Security.Claims;
3-
using System.Xml.Linq;
43
using Microsoft.AspNetCore.Http.HttpResults;
54
using Npgsql;
65

NpgsqlRest/Interfaces.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Npgsql;
2-
1+
using Npgsql;
32
namespace NpgsqlRest;
43

54
public interface IEndpointCreateHandler

NpgsqlRest/NpgsqlRestMiddlewareExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Microsoft.Extensions.Logging;
2-
using System.Linq;
32
using System.Net;
43
using static System.Net.Mime.MediaTypeNames;
54

NpgsqlRest/NpgsqlRestOptions.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public NpgsqlRestOptions(NpgsqlDataSource dataSource)
104104
public string? UrlPathPrefix { get; set; } = "/api";
105105

106106
/// <summary>
107-
/// Custom function delegate that receives routine and options parameters and returns constructed URL path string for routine. Default the default URL builder that transforms snake case names to kebab case names.
107+
/// Custom function delegate that receives routine and options parameters and returns constructed URL path string for routine. Default is the default URL builder that transforms snake case names to kebab case names.
108108
/// </summary>
109109
public Func<Routine, NpgsqlRestOptions, string> UrlPathBuilder { get; set; } = DefaultUrlBuilder.CreateUrl;
110110

@@ -181,7 +181,7 @@ public NpgsqlRestOptions(NpgsqlDataSource dataSource)
181181
public Method? DefaultHttpMethod { get; set; }
182182

183183
/// <summary>
184-
/// When not null, sets the request parameter position (request parameter types) for all created endpoints. Values are `QueryString` (parameters are sent using query string) or `BodyJson` (paremeters are sent using JSON request body). When this value is null (default), request parameter type is `QueryString` for all `GET` and `DELETE` endpoints, otherwise, request parameter type is `BodyJson`. This option for individual endpoints can be changed with the `EndpointCreated` function callback, or by using comment annotations.
184+
/// When not null, sets the request parameter position (request parameter types) for all created endpoints. Values are `QueryString` (parameters are sent using query string) or `BodyJson` (parameters are sent using JSON request body). When this value is null (default), request parameter type is `QueryString` for all `GET` and `DELETE` endpoints, otherwise, request parameter type is `BodyJson`. This option for individual endpoints can be changed with the `EndpointCreated` function callback, or by using comment annotations.
185185
/// </summary>
186186
public RequestParamType? DefaultRequestParamType { get; set; }
187187

@@ -191,7 +191,7 @@ public NpgsqlRestOptions(NpgsqlDataSource dataSource)
191191
public Action<ParameterValidationValues>? ValidateParameters { get; set; }
192192

193193
/// <summary>
194-
/// Custom parameter validation method, asynchrounous version. When this callback option is not null, it will be executed for every database parameter created. The input structure will contain a current HTTP context that offers the opportunity to alter the response and cancel the request: If the current HTTP response reference has started or the status code is different than 200 OK, command execution will be canceled and the response will be returned.
194+
/// Custom parameter validation method, asynchronous version. When this callback option is not null, it will be executed for every database parameter created. The input structure will contain a current HTTP context that offers the opportunity to alter the response and cancel the request: If the current HTTP response reference has started or the status code is different than 200 OK, command execution will be canceled and the response will be returned.
195195
/// </summary>
196196
public Func<ParameterValidationValues, Task>? ValidateParametersAsync { get; set; }
197197

@@ -201,7 +201,7 @@ public NpgsqlRestOptions(NpgsqlDataSource dataSource)
201201
public CommentsMode CommentsMode { get; set; } = CommentsMode.OnlyWithHttpTag;
202202

203203
/// <summary>
204-
/// Configure how to send request headers to PostgreSQL routines execution. `Ignore` (default) don't send any request headers to routines. `Context` sets a context variable for the current session `context.headers` containing JSON string with current request headers. This executes `set_config('context.headers', headers, false)` before any routine executions. `Parameter` sends request headers to the routine parameter defined with the `RequestHeadersParameterName` option. Paremeter with this name must exist, must be one of the JSON or text types and must have the default value defined. This option for individual endpoints can be changed with the `EndpointCreated` function callback, or by using comment annotations.
204+
/// Configure how to send request headers to PostgreSQL routines execution. `Ignore` (default) doesn't send any request headers to routines. `Context` sets a context variable for the current session `context.headers` containing JSON string with current request headers. This executes `set_config('context.headers', headers, false)` before any routine executions. `Parameter` sends request headers to the routine parameter defined with the `RequestHeadersParameterName` option. Parameter with this name must exist, must be one of the JSON or text types and must have the default value defined. This option for individual endpoints can be changed with the `EndpointCreated` function callback, or by using comment annotations.
205205
/// </summary>
206206
public RequestHeadersMode RequestHeadersMode { get; set; } = RequestHeadersMode.Ignore;
207207

@@ -314,7 +314,7 @@ public NpgsqlRestOptions(NpgsqlDataSource dataSource)
314314
public IRoutineCache DefaultRoutineCache { get; set; } = new RoutineCache();
315315

316316
/// <summary>
317-
/// When cache is enabled, this value sets the interval in minutes for cache pruning (removing expired entires). Default is 1 minute.
317+
/// When cache is enabled, this value sets the interval in minutes for cache pruning (removing expired entries). Default is 1 minute.
318318
/// </summary>
319319
public int CachePruneIntervalMin { get; set; } = 1;
320320

@@ -365,7 +365,7 @@ public class NpgsqlRestUploadOptions
365365

366366
/// <summary>
367367
/// Name of the default upload metadata parameter.
368-
/// This parameter is will be automatically assigned with the upload metadata JSON string when the upload is completed if UseDefaultUploadMetadataParameter is set to true.
368+
/// This parameter will be automatically assigned with the upload metadata JSON string when the upload is completed if UseDefaultUploadMetadataParameter is set to true.
369369
/// </summary>
370370
public string DefaultUploadMetadataParameterName { get; set; } = "_upload_metadata";
371371

@@ -397,23 +397,23 @@ public class NpgsqlRestAuthenticationOptions
397397
public string? DefaultAuthenticationType { get; set; } = null;
398398

399399
/// <summary>
400-
/// The default column name to in the data reader which will be used to read the value to determine the success or failure of the login operation.
400+
/// The default column name in the data reader which will be used to read the value to determine the success or failure of the login operation.
401401
///
402402
/// - If this column is not present, the success is when the endpoint returns any records.
403-
/// - If this column is not present, it must be either a boolean to indicate success or a numeric value to indicate the HTTP Status Code to return.
403+
/// - If this column is present, it must be either a boolean to indicate success or a numeric value to indicate the HTTP Status Code to return.
404404
/// - If this column is present and retrieves a numeric value, that value is assigned to the HTTP Status Code and the login will authenticate only when this value is 200.
405405
/// </summary>
406406
public string? StatusColumnName { get; set; } = "status";
407407

408408
/// <summary>
409-
/// The default column name to in the data reader which will be used to read the value of the authentication scheme of the login process.
409+
/// The default column name in the data reader which will be used to read the value of the authentication scheme of the login process.
410410
///
411411
/// If this column is not present in the login response the default authentication scheme is used. Return new value to use a different authentication scheme with the login endpoint.
412412
/// </summary>
413413
public string? SchemeColumnName { get; set; } = "scheme";
414414

415415
/// <summary>
416-
/// The default column name to in the data reader which will return a text message with the login status.
416+
/// The default column name in the data reader which will return a text message with the login status.
417417
/// </summary>
418418
public string? MessageColumnName { get; set; } = "message";
419419

@@ -471,7 +471,7 @@ public string DefaultNameClaimType
471471
public bool ObfuscateAuthParameterLogValues { get; set; } = true;
472472

473473
/// <summary>
474-
/// The default column name to in the data reader which will be used to read the value of the hash of the password.
474+
/// The default column name in the data reader which will be used to read the value of the hash of the password.
475475
/// If this column is present, the value will be used to verify the password from the password parameter.
476476
/// Password parameter is the first parameter which name contains the value of PasswordParameterNameContains.
477477
/// If verification fails, the login will fail and the HTTP Status Code will be set to 404 Not Found.

0 commit comments

Comments
 (0)