Skip to content

Commit e2c5be0

Browse files
committed
style: spacing in BaseJsonApiController<,>
1 parent 2e94d8e commit e2c5be0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,15 @@ public virtual async Task<IActionResult> GetAsync(TId id)
115115
if (_getById == null) throw Exceptions.UnSupportedRequestMethod;
116116
var entity = await _getById.GetAsync(id);
117117
if (entity == null)
118-
{
119118
return NotFound();
120-
}
119+
121120
return Ok(entity);
122121
}
123122

124123
public virtual async Task<IActionResult> GetRelationshipsAsync(TId id, string relationshipName)
125124
{
126125
if (_getRelationships == null)
127-
{
128126
throw Exceptions.UnSupportedRequestMethod;
129-
}
130127
var relationship = await _getRelationships.GetRelationshipsAsync(id, relationshipName);
131128
if (relationship == null)
132129
return NotFound();
@@ -153,7 +150,7 @@ public virtual async Task<IActionResult> PostAsync([FromBody] T entity)
153150
return Forbidden();
154151

155152
if (_jsonApiOptions.ValidateModelState && !ModelState.IsValid)
156-
return UnprocessableEntity(ModelStateExtensions.ConvertToErrorCollection<T>(ModelState, GetAssociatedResource()));
153+
return UnprocessableEntity(ModelState.ConvertToErrorCollection<T>(GetAssociatedResource()));
157154

158155
entity = await _create.CreateAsync(entity);
159156

@@ -167,7 +164,7 @@ public virtual async Task<IActionResult> PatchAsync(TId id, [FromBody] T entity)
167164
return UnprocessableEntity();
168165

169166
if (_jsonApiOptions.ValidateModelState && !ModelState.IsValid)
170-
return UnprocessableEntity(ModelStateExtensions.ConvertToErrorCollection<T>(ModelState, GetAssociatedResource()));
167+
return UnprocessableEntity(ModelState.ConvertToErrorCollection<T>(GetAssociatedResource()));
171168

172169
var updatedEntity = await _update.UpdateAsync(id, entity);
173170

src/JsonApiDotNetCore/Internal/ResourceGraph.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections;
32
using System.Collections.Generic;
43
using System.Linq;
54
using JsonApiDotNetCore.Internal.Contracts;

0 commit comments

Comments
 (0)