Skip to content

Commit

Permalink
Implemented suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelL79 committed Dec 9, 2024
1 parent 4b5446f commit c38245f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/FMData.Rest/FileMakerRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ public class FileMakerRestClient : FileMakerApiClientBase, IFileMakerRestClient
/// <param name="file">Name of the FileMaker Database to connect to.</param>
/// <param name="user">Account to connect with.</param>
/// <param name="pass">Account to connect with.</param>
/// <param name="targetVersion">Version of the DataAPI endpoint to use. Default is v1.</param>
[Obsolete("Creates a new HttpClient for this instance, and is generally not good. Inject a managed client.")]
public FileMakerRestClient(string fmsUri, string file, string user, string pass, RestTargetVersion targetVersion = RestTargetVersion.v1)
: this(new HttpClient(), new ConnectionInfo { FmsUri = fmsUri, Database = file, Username = user, Password = pass, RestTargetVersion = targetVersion }) { }
public FileMakerRestClient(string fmsUri, string file, string user, string pass)
: this(new HttpClient(), new ConnectionInfo { FmsUri = fmsUri, Database = file, Username = user, Password = pass }) { }

/// <summary>
/// FM Data Constructor with HttpClient and ConnectionInfo. Useful for Dependency Injection situations.
Expand Down Expand Up @@ -103,15 +102,17 @@ public FileMakerRestClient(
switch (_authTokenProvider.ConnectionInfo?.RestTargetVersion)
{
case RestTargetVersion.v1:
case null:
_targetVersion = "v1";
break;
case RestTargetVersion.v2:
_targetVersion = "v2";
break;
default:
case RestTargetVersion.vLatest:
_targetVersion = "vLatest";
break;
default:
_targetVersion = "v1";
break;
}
#if NETSTANDARD1_3
var header = new System.Net.Http.Headers.ProductHeaderValue("FMData.Rest", "4");
Expand Down
1 change: 0 additions & 1 deletion tests/FMData.Rest.Tests/GeneralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ public void Test_EndpointVersion_vLatest()

private IEnumerable<FileMakerRestClient> CreateEndpointTestClients(RestTargetVersion? targetVersion)
{

var mockHttp = new MockHttpMessageHandler();
var server = "http://localhost";
var file = "test-file";
Expand Down

0 comments on commit c38245f

Please sign in to comment.