0
I have an endpoint as follows:
[HttpGet]
[ProducesResponseType(typeof(IEnumerable<TestsDto>), (int)HttpStatusCode.OK)]
public async Task<ActionResult<IEnumerable<TestsDto>>> GetAsync(Guid textId, Guid phraseId, Guid heightId, Guid? weightId, Guid? productId, decimal? value, DateTime? date)
{
var test= await _testingHandler.GetAsync(textId, phraseId, currencyId, heightId, weightId, value, date );
return Ok(apps);
}
How do I validate, if the last field that is date
no value is passed to it I always assign the current date in this field ?
date ?? DateTime.Now
?– Jéf Bueno
@LINQ can pass directly in the same string type parameter, in case
string algumacoisa = ""
? so the variable is a string but if nothing passes it is always empty. In the case of the date I could not do– Desalex