Skip to content

Instantly share code, notes, and snippets.

@cerkit
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cerkit/9761375 to your computer and use it in GitHub Desktop.
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
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