working on base class and implementation
parent
1991739287
commit
db3c94b36e
@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<RootNamespace>OSI_API.Business</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Restsharp" Version="106.11.7" />
|
||||||
|
<PackageReference Include="System.Text.Json" Version="5.0.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace OSI.API.Business.Objects
|
||||||
|
{
|
||||||
|
public class InvoiceObject
|
||||||
|
{
|
||||||
|
public int InvoiceNumber { get; set; }
|
||||||
|
public float InvoiceAmount { get; set; }
|
||||||
|
public float Discount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OSI.API.Controllers
|
||||||
|
{
|
||||||
|
public abstract class EndpointBase<A> : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet]
|
||||||
|
public abstract IActionResult Get();
|
||||||
|
|
||||||
|
// GET: api/Clients/5
|
||||||
|
[HttpGet("{id}")]
|
||||||
|
public abstract IActionResult Get(int id);
|
||||||
|
|
||||||
|
// POST: api/Clients
|
||||||
|
[HttpPost]
|
||||||
|
public abstract IActionResult Post([FromBody] A input);
|
||||||
|
|
||||||
|
// PUT: api/Clients/5
|
||||||
|
[HttpPut("{id}")]
|
||||||
|
public abstract IActionResult Put(int id, [FromBody] A input);
|
||||||
|
|
||||||
|
// DELETE: api/Clients/5
|
||||||
|
[HttpDelete("{id}")]
|
||||||
|
public abstract IActionResult Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue