Initial commit

This commit is contained in:
2020-04-12 20:52:03 -04:00
parent e750d2848a
commit 01e7627293
249 changed files with 9733 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// Decompiled with JetBrains decompiler
// Type: PartSource.Controllers.BaseNexpartController
// Assembly: PartSource, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9C95A003-DAA7-4079-9F59-D1FC80E1666C
// Assembly location: C:\Users\Tommy\Desktop\PS temp\PartSource.dll
using Microsoft.AspNetCore.Mvc;
using PartSource.Data.Nexpart;
using PartSource.Data.Nexpart.Interfaces;
namespace PartSource.Api.Controllers
{
public class BaseNexpartController : ControllerBase
{
protected ActionResult NexpartResponse<T, U>(T response) where T : IResponseElement<U>
{
Exceptions[] exceptions = response.PSResponseHeader.Exceptions;
if ((exceptions != null ? ((uint)exceptions.Length > 0U ? 1 : 0) : 0) == 0)
{
return Ok(new
{
Data = response.ResponseBody
});
}
string empty = string.Empty;
foreach (Exceptions exception in response.PSResponseHeader.Exceptions)
empty += string.Format("{0}\n", (object)exception.Value);
return BadRequest(new
{
Data = response.ResponseBody
});
}
}
}