4
Answers

Need to create parameterized constructor in webAPI

Anjali Kumari

Anjali Kumari

7y
7.9k
1
I need some sample example with parameterized constructor using reprository and web-API
 
I tried this:
public class TestUserController : ApiController
{

private readonly IUserRepository  UserRepository;

public TestUsersController()
{

}
public TestUsersController(IUserRepository  UserRepository)
{
this.UserRepository = UserRepository;.........this parameterized constructor is not hitting and getting always null
} 
Answers (4)