Добавил роуты до контроллер? чтобы получить доступы через постман

parent 5befd221
...@@ -5,6 +5,7 @@ using Payment.WebApi.Repositories.Interfaces; ...@@ -5,6 +5,7 @@ using Payment.WebApi.Repositories.Interfaces;
namespace Payment.WebApi.Controllers; namespace Payment.WebApi.Controllers;
[ApiController] [ApiController]
[Route("Suppliers/[action]")]
public class SupplierController : Controller public class SupplierController : Controller
{ {
private readonly ISupplierRepository _supplierRepository; private readonly ISupplierRepository _supplierRepository;
...@@ -14,6 +15,8 @@ public class SupplierController : Controller ...@@ -14,6 +15,8 @@ public class SupplierController : Controller
_supplierRepository = supplierRepository; _supplierRepository = supplierRepository;
} }
[HttpGet]
[ActionName("GetAll")]
public ActionResult<List<Supplier>> GetAll() public ActionResult<List<Supplier>> GetAll()
{ {
try try
......
...@@ -5,6 +5,7 @@ using Payment.WebApi.Repositories.Interfaces; ...@@ -5,6 +5,7 @@ using Payment.WebApi.Repositories.Interfaces;
namespace Payment.WebApi.Controllers; namespace Payment.WebApi.Controllers;
[ApiController] [ApiController]
[Route("Users/[action]")]
public class UserController : Controller public class UserController : Controller
{ {
private readonly IUserRepository _userRepository; private readonly IUserRepository _userRepository;
...@@ -14,6 +15,8 @@ public class UserController : Controller ...@@ -14,6 +15,8 @@ public class UserController : Controller
_userRepository = userRepository; _userRepository = userRepository;
} }
[HttpGet]
[ActionName("GetUser")]
public ActionResult<User> GetUser(int id) public ActionResult<User> GetUser(int id)
{ {
try try
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment