File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ protected IActionResult Error(Error error)
23
23
protected IActionResult Errors ( IEnumerable < Error > errors )
24
24
{
25
25
var document = new ErrorDocument ( errors . ToList ( ) ) ;
26
- return document . AsActionResult ( ) ;
26
+
27
+ return new ObjectResult ( document )
28
+ {
29
+ StatusCode = ( int ) document . GetErrorStatusCode ( )
30
+ } ;
27
31
}
28
32
}
29
33
}
Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
2
using System . Linq ;
3
3
using System . Net ;
4
- using Microsoft . AspNetCore . Mvc ;
5
4
6
5
namespace JsonApiDotNetCore . Models . JsonApiDocuments
7
6
{
@@ -37,13 +36,5 @@ public HttpStatusCode GetErrorStatusCode()
37
36
var statusCode = int . Parse ( statusCodes . Max ( ) . ToString ( ) [ 0 ] + "00" ) ;
38
37
return ( HttpStatusCode ) statusCode ;
39
38
}
40
-
41
- public IActionResult AsActionResult ( )
42
- {
43
- return new ObjectResult ( this )
44
- {
45
- StatusCode = ( int ) GetErrorStatusCode ( )
46
- } ;
47
- }
48
39
}
49
40
}
You can’t perform that action at this time.
0 commit comments