Skip to content

Commit

Permalink
remove Func<,> UriGenerator methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusz96 committed Dec 13, 2023
1 parent 55c04c0 commit 80e9309
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 116 deletions.
4 changes: 0 additions & 4 deletions src/UriGeneration/IUriGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ namespace UriGeneration
public interface IUriGenerator
{
string? GetPathByExpression<TController>(Expression<Action<TController>> action, string? endpointName = null, PathString pathBase = default, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetPathByExpression<TController>(Expression<Func<TController, object?>> action, string? endpointName = null, PathString pathBase = default, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetPathByExpression<TController>(HttpContext httpContext, Expression<Action<TController>> action, string? endpointName = null, PathString? pathBase = null, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetPathByExpression<TController>(HttpContext httpContext, Expression<Func<TController, object?>> action, string? endpointName = null, PathString? pathBase = null, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetUriByExpression<TController>(Expression<Action<TController>> action, string? endpointName, string scheme, HostString host, PathString pathBase = default, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetUriByExpression<TController>(Expression<Func<TController, object?>> action, string? endpointName, string scheme, HostString host, PathString pathBase = default, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetUriByExpression<TController>(HttpContext httpContext, Expression<Action<TController>> action, string? endpointName = null, string? scheme = null, HostString? host = null, PathString? pathBase = null, FragmentString fragment = default, UriOptions? options = null) where TController : class;
string? GetUriByExpression<TController>(HttpContext httpContext, Expression<Func<TController, object?>> action, string? endpointName = null, string? scheme = null, HostString? host = null, PathString? pathBase = null, FragmentString fragment = default, UriOptions? options = null) where TController : class;
}
}
106 changes: 0 additions & 106 deletions src/UriGeneration/Internal/UriGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,6 @@ public UriGenerator(
options);
}

public string? GetPathByExpression<TController>(
Expression<Func<TController, object?>> action,
string? endpointName = null,
PathString pathBase = default,
FragmentString fragment = default,
UriOptions? options = null)
where TController : class
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}

return GetPathByExpressionWithoutHttpContext<TController>(
action,
endpointName,
pathBase,
fragment,
options);
}

public string? GetPathByExpression<TController>(
HttpContext httpContext,
Expression<Action<TController>> action,
Expand Down Expand Up @@ -98,34 +77,6 @@ public UriGenerator(
options);
}

public string? GetPathByExpression<TController>(
HttpContext httpContext,
Expression<Func<TController, object?>> action,
string? endpointName = null,
PathString? pathBase = null,
FragmentString fragment = default,
UriOptions? options = null)
where TController : class
{
if (httpContext == null)
{
throw new ArgumentNullException(nameof(httpContext));
}

if (action == null)
{
throw new ArgumentNullException(nameof(action));
}

return GetPathByExpressionWithHttpContext<TController>(
httpContext,
action,
endpointName,
pathBase,
fragment,
options);
}

public string? GetUriByExpression<TController>(
Expression<Action<TController>> action,
string? endpointName,
Expand All @@ -151,31 +102,6 @@ public UriGenerator(
options);
}

public string? GetUriByExpression<TController>(
Expression<Func<TController, object?>> action,
string? endpointName,
string scheme,
HostString host,
PathString pathBase = default,
FragmentString fragment = default,
UriOptions? options = null)
where TController : class
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}

return GetUriByExpressionWithoutHttpContext<TController>(
action,
endpointName,
scheme,
host,
pathBase,
fragment,
options);
}

public string? GetUriByExpression<TController>(
HttpContext httpContext,
Expression<Action<TController>> action,
Expand Down Expand Up @@ -208,38 +134,6 @@ public UriGenerator(
options);
}

public string? GetUriByExpression<TController>(
HttpContext httpContext,
Expression<Func<TController, object?>> action,
string? endpointName = null,
string? scheme = null,
HostString? host = null,
PathString? pathBase = null,
FragmentString fragment = default,
UriOptions? options = null)
where TController : class
{
if (httpContext == null)
{
throw new ArgumentNullException(nameof(httpContext));
}

if (action == null)
{
throw new ArgumentNullException(nameof(action));
}

return GetUriByExpressionWithHttpContext<TController>(
httpContext,
action,
endpointName,
scheme,
host,
pathBase,
fragment,
options);
}

private string? GetPathByExpressionWithoutHttpContext<TController>(
LambdaExpression action,
string? endpointName = null,
Expand Down
6 changes: 0 additions & 6 deletions src/UriGeneration/Internal/ValuesExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ private bool TryExtractMethodCall(
{
methodCall = actionBody as MethodCallExpression;

if (methodCall == null
&& actionBody is UnaryExpression objectCast)
{
methodCall = objectCast.Operand as MethodCallExpression;
}

if (methodCall == null)
{
_logger.MethodCallNotExtracted(actionBody);
Expand Down

0 comments on commit 80e9309

Please sign in to comment.