I have an api, I'm sending multiple parameters here. url is as follows.
http://localhost:7150/api/logLoginDetails/GetLogLoginDetails?userId=&userIp=192.168.2.1&startTime=22.9.2020 18:07:13&endTime=23.9.2020 18:07:13
but when I switch to the api, only userIp information comes. The userId field should be null, but what should I do to ensure that the fields containing datetime are not null.
In the method below, only userIp information is filled.
[RoutePrefix("api/logLoginDetails")]
public class LogLoginDetailsController : ApiBaseController
{
[HttpGet, Route ("GetLogLoginDetails")]
public HttpResponseMessage GetLogLoginDetails (int? userId = null, string userIp = null, DateTime? startTime = null, DateTime? endTime = null)
{
try
{
return CROk (logLoginDetailsService.GetLogLoginDetails (userId: userId, userIp: userIp, startTime: startTime, endTime: endTime));
}
catch (Exception e)
{
return CRException (e);
}
}
}