Skip to content

Commit 867134e

Browse files
Merge pull request #35 from elsupergomez/change-controller-to-controllerbase
Use ControllerBase instead Controller
2 parents b6507bb + 418b6a4 commit 867134e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/MakingSense.AspNetCore.HypermediaApi/Linking/BaseLinkHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
44
using System.Linq;
@@ -46,14 +46,14 @@ private static string ExtractControllerName(MethodInfo methodInfo)
4646
}
4747

4848
public Maybe<Link> ToAction<T>(Expression<Func<T, Task>> expression)
49-
where T : Controller
49+
where T : ControllerBase
5050
{
5151
var methodCallExpression = (MethodCallExpression)expression.Body;
5252
return ToAction(methodCallExpression.Method, methodCallExpression.Arguments);
5353
}
5454

5555
public Maybe<Link> ToAction<T>(Expression<Action<T>> expression)
56-
where T : Controller
56+
where T : ControllerBase
5757
{
5858
var methodCallExpression = (MethodCallExpression)expression.Body;
5959
return ToAction(methodCallExpression.Method, methodCallExpression.Arguments);

src/MakingSense.AspNetCore.HypermediaApi/Linking/ILinkHelper.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
using MakingSense.AspNetCore.Abstractions;
2-
using Microsoft.AspNetCore.Http;
32
using Microsoft.AspNetCore.Mvc;
43
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
74
using System.Linq.Expressions;
8-
using System.Reflection;
95
using System.Threading.Tasks;
106

117
namespace MakingSense.AspNetCore.HypermediaApi.Linking
128
{
139
public interface ILinkHelper
1410
{
15-
Maybe<Link> ToAction<T>(Expression<Func<T, Task>> expression) where T : Controller;
16-
Maybe<Link> ToAction<T>(Expression<Action<T>> expression) where T : Controller;
11+
Maybe<Link> ToAction<T>(Expression<Func<T, Task>> expression) where T : ControllerBase;
12+
Maybe<Link> ToAction<T>(Expression<Action<T>> expression) where T : ControllerBase;
1713
Maybe<Link> ToSelf(object values = null);
1814
Maybe<Link> ToAbsolute(string href);
1915
Maybe<Link> ToAbsolute(Uri uri);

0 commit comments

Comments
 (0)