User1838940990 posted
Hi All,
hope you all are safe.
We have asp.net core web api with multiple endpoints for different categories
eg : ww.url.com/category1/create
ww.url.com/category2/create
Since we don't to expose the category name , planning to expose single controller and category will be passed a field in parameter and palln to pu if condition to service the request
ww.url.com/create
[HttpPost("create")]
public IActionResult Create( category category )
{
if category.Type ==category1
{
category1.service.create();
}
elseif category.Type ==category2
{
category2.service.create();
}
}
We are going to have more than 8-10 conditon now and it can grow
or is there any pattern to handle these type of requirement like this ?
have a nice day ahead
thanks,