Код: Выделить всё
[Authorize]
[HttpGet]
public async Task GetAll(int pageNumber, int pageSize, string searchString, string orderBy, int productId = 0)
{
if (UserId == null)
return BadRequest();
var products = await _mediator.Send(new GetUserConfigQuery((Guid)UserId, pageNumber, pageSize, searchString, orderBy)
{
ProductId = productId,
});
return Ok(products);
}
Код: Выделить всё
public async Task GetAll(int pageNumber, int pageSize, string? searchString, string? orderBy, int productId = 0)
Код: Выделить всё
builder.Services.AddControllers(o =>
{
//o.AllowEmptyInputInBodyModelBinding = true;
o.SuppressImplicitRequiredAttributeForNonNullableReferenceTypes = true;
}).AddValidators();
Подробнее здесь: https://stackoverflow.com/questions/791 ... pi-methods
Мобильная версия