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 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Rahul SharmaPosted May 24, 2021, 5:47 AM
Sachin SinghPosted May 23, 2021, 9:15 AM