Hi,
I need to create a method, which now will be a UI. Later i need to expose it as api as well. I am using MVC core as my project.
Here is the code for UI. How i can expose this AddUser as api call.
public class UserController : Controller
{
[HttpPost]
public async Task<IActionResult> AddUser(UserModel _userModel)
{
//UserManager is a business class
UserManager _userManager=new UserManager ();
_userManager.AddNewUser(_userModel);
return View(_userModel);
}
}