I have a method in Web API.
[HttpGet]
[HandleException("Unable to get Sections")]
[Route("Sections")]
public IHttpActionResult Sections()
{
var data = directoryDataService.Sections(1);
if (data != null && data.Count > 0)
{
response.Data = data;
return new Success(Request, "Sections Retrieved Successfully", response);
}
return new Error(Request, "No Sections Found");
}
I have a doubt on the status code that I m return as a response. Currently if list of sections is available means returns "200" with data. If no sections available means, That is count of section is 0 means returns "400".
Is it right? Or I want to give 200 itself if count is 0.