public GetAllStatesResponse GetAllStates() { var response = new GetAllStatesResponse(); var states = _stateRepository.FindAll(); response.States = states.ConvertToStateViews(); return(response); }
public GetAllStatesResponse GetAllStates(GetAllStatesRequest request) { GetAllStatesResponse response = new GetAllStatesResponse(); IEnumerable <State> states; states = repository.GetAllStates(); if (states == null) { throw new ResourceNotFoundException("The requested states list was not found."); } response.States = states; return(response); }