Add AutoMapper

This commit is contained in:
2019-03-12 22:23:38 +01:00
parent 3b16c5feaf
commit 30f64257e7
16 changed files with 137 additions and 59 deletions

View File

@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc;
namespace LaDOSE.Api.Controllers
{
public class GenericController<T,TU> :Controller where TU : Entity.Context.Entity where T : IBaseService<TU>
public class GenericController<T, TU> : Controller where TU : Entity.Context.Entity where T : IBaseService<TU>
{
protected T _service;
@@ -16,10 +16,11 @@ namespace LaDOSE.Api.Controllers
}
[HttpPost]
public TU Post([FromBody]TU dto)
public TU Post([FromBody] TU dto)
{
return _service.AddOrUpdate(dto);
}
[HttpGet]
public List<TU> Get()
{
@@ -27,6 +28,7 @@ namespace LaDOSE.Api.Controllers
return _service.GetAll().ToList();
}
[HttpGet("{id}")]
public TU Get(int id)
{