Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Missing Ok() in Controller #2825

Closed
Closed
@Bartmax

Description

@Bartmax

I think there's a missing helper in controller to return an object. or I can't find it :)

public virtual ObjectResult Ok(object value);

so

[HttpGet("{id}")]
public IActionResult Detail(int id)
{
    var ret = xxx.GetById(id);
    if (ret == null) return HttpNotFound($"id {id} does not exist");
    return Ok(ret);
}

instead of:

return new ObjectResult(ret);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions