skip to Main Content

URLs ignore arguments in GET request (ASP.NET)

I need to write a Web API for this request: {apiUrl}/api/sessions/byhour?startTime=2021-06-30T01:00:00&endTime=2021-06-30T03:00:00 So I have this controller and method: [ApiController] [Route("/api/sessions/byhour")] public class LoginStatsByHourController : ControllerBase { [HttpGet, Route("{startTime=0001-01-01T12:00:00}/{endTime=9999-12-31T11:59:59}")] public List<SessionEntry> GetSessionEntryByDate(string startTime, string endTime) {...} } I tested this request:…

VIEW QUESTION

Xcode – How to remove extra zeros

Sorry for the basic question, I just started learning C. This is the output I'm trying to get: https://i.stack.imgur.com/t6D30.png This is what I'm currently getting: https://i.stack.imgur.com/0yoSQ.png How do I get rid of the extra three zeros at the end of…

VIEW QUESTION

How to call a function in page load asp.net?

The function below is found in a class called page.cs public static List<string> MyFunction() { var retList = new List<string>(); retList.Add("xzy"); retList.Add("abc"); return retList; } On page load how to call the function and check if the list contains xzy…

VIEW QUESTION
Back To Top
Search