Last active
August 29, 2015 13:57
-
-
Save cerkit/9761375 to your computer and use it in GitHub Desktop.
The Controller responsible for retrieving the album format information from the data store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace RecordKeeperApi.Controllers | |
{ | |
public class AlbumFormatController : ApiController | |
{ | |
private IFormatRepository _repository; | |
public AlbumFormatController() : this(new FormatRepository()) { } | |
public AlbumFormatController(IFormatRepository repository) | |
{ | |
_repository = repository; | |
} | |
// GET api/<controller> | |
public IEnumerable<AlbumFormat> Get() | |
{ | |
return _repository.GetAll(); | |
} | |
// GET api/<controller>/CD | |
public AlbumFormat Get(string id) | |
{ | |
return _repository.Get(id); | |
} | |
// ... Additional Controller code | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment