متن ساده
متن ساده
چارچوب قدرتمند برای سرویسهای وب
[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase
{
private readonly IProductService _service;
public ProductsController(IProductService service)
{
_service = service;
}
}
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options => {
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidateAudience = true
};
});
/// دریافت لیست محصولات
[HttpGet]
[ProducesResponseType(200)]
public IActionResult Get()
ایجاد APIهای قابل اعتماد و امن