@@ -115,18 +115,15 @@ public virtual async Task<IActionResult> GetAsync(TId id)
115
115
if ( _getById == null ) throw Exceptions . UnSupportedRequestMethod ;
116
116
var entity = await _getById . GetAsync ( id ) ;
117
117
if ( entity == null )
118
- {
119
118
return NotFound ( ) ;
120
- }
119
+
121
120
return Ok ( entity ) ;
122
121
}
123
122
124
123
public virtual async Task < IActionResult > GetRelationshipsAsync ( TId id , string relationshipName )
125
124
{
126
125
if ( _getRelationships == null )
127
- {
128
126
throw Exceptions . UnSupportedRequestMethod ;
129
- }
130
127
var relationship = await _getRelationships . GetRelationshipsAsync ( id , relationshipName ) ;
131
128
if ( relationship == null )
132
129
return NotFound ( ) ;
@@ -153,7 +150,7 @@ public virtual async Task<IActionResult> PostAsync([FromBody] T entity)
153
150
return Forbidden ( ) ;
154
151
155
152
if ( _jsonApiOptions . ValidateModelState && ! ModelState . IsValid )
156
- return UnprocessableEntity ( ModelStateExtensions . ConvertToErrorCollection < T > ( ModelState , GetAssociatedResource ( ) ) ) ;
153
+ return UnprocessableEntity ( ModelState . ConvertToErrorCollection < T > ( GetAssociatedResource ( ) ) ) ;
157
154
158
155
entity = await _create . CreateAsync ( entity ) ;
159
156
@@ -167,7 +164,7 @@ public virtual async Task<IActionResult> PatchAsync(TId id, [FromBody] T entity)
167
164
return UnprocessableEntity ( ) ;
168
165
169
166
if ( _jsonApiOptions . ValidateModelState && ! ModelState . IsValid )
170
- return UnprocessableEntity ( ModelStateExtensions . ConvertToErrorCollection < T > ( ModelState , GetAssociatedResource ( ) ) ) ;
167
+ return UnprocessableEntity ( ModelState . ConvertToErrorCollection < T > ( GetAssociatedResource ( ) ) ) ;
171
168
172
169
var updatedEntity = await _update . UpdateAsync ( id , entity ) ;
173
170
0 commit comments