public Album Get(int id)
{
try
{
var db = _albumRepository.Find(a => a.AlbumId == id, true).FirstOrDefault();
if (db == null)
{
return new Album().GenerateError<Album>((int)Constants.Error.RecordNotFound,
string.Format("Cannot find album with Id {0}", id));
}
return AlbumMapper.ToDto(db);
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
}