Anjali Kumari

Anjali Kumari

  • NA
  • 163
  • 4.6k

Need to create parameterized constructor in webAPI

Jun 28 2017 9:29 AM
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)