I want to validate the parameter in web api's get request. How to achieve this.
code:
- [HttpGet("{id}")]
- public async Task
> GetSchedd( string id) - {
- return Ok(await _context.Schedds.FromSqlRaw
( "sp_userprofile {0},{1},{2}", id, 7, null).ToListAsync()); - }
Here String id must not contain any symbol or alphapet.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sachin SinghRank #66 · 26.2K reputationPosted May 23, 2021, 5:15 AM EDT
Rahul Sharma195 reputationPosted May 24, 2021, 1:47 AM EDT