Code-complete v2 vehicle API

This commit is contained in:
2020-07-26 21:52:36 -04:00
parent 48dc190027
commit f2ca3419b0
28 changed files with 1292 additions and 1001 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace PartSource.Api.Controllers
{
public class BaseApiController : ControllerBase
{
public ActionResult ApiResponse<T>(T response)
{
switch (response)
{
case IList list:
if (list.Count == 0)
{
return NoContent();
}
break;
default:
if (response == null)
{
return NotFound();
}
break;
}
return Ok(response);
}
}
}