public IHttpController Create( HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType) { if (controllerType == typeof(NameListController)) { if (_nameListRepository == null) { _nameListRepository = new InMemoryNameListRepository(); _nameListRepository.Create(new NameListEntry("firstname1", "lastname1", "*****@*****.**")); _nameListRepository.Create(new NameListEntry("firstname2", "lastname2", "*****@*****.**")); } return(new NameListController(_nameListRepository)); } return(null); }
public void Post([FromBody] NameListEntry nameListEntry) { _nameListRepository.Create(nameListEntry); }