I want to validate the parameter in web api's get request. How to achieve this.
code:
- [HttpGet("{id}")]
- public async Task<ActionResult<Schedd>> GetSchedd(string id)
- {
- return Ok(await _context.Schedds.FromSqlRaw<Schedd>("sp_userprofile {0},{1},{2}", id, 7, null).ToListAsync());
- }
Here String id must not contain any symbol or alphapet.