UsersConroller.cs 562 B

1234567891011121314151617
  1. using BelovAPI.BaseConnection;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using BelovAPI.BaseConnection;
  5. namespace BelovAPI.Controllers
  6. {
  7. [Route("api/[controller]/{name}")]
  8. [ApiController]
  9. [ApiExplorerSettings(GroupName = "Действия с пользователем")]
  10. public class UsersController : ControllerBase
  11. {
  12. ApplicationContext db = new ApplicationContext();
  13. [HttpGet]
  14. public IActionResult Index(string name) => Ok(db.User.Where(x => x.nameUser.Contains(name)).ToList());
  15. }
  16. }