Esempio n. 1
0
        public IEnumerable<CharacterModel> ListCharactersInSeason(int season)
        {
            try
            {
                Logger.Trace("Begin => ListCharactersInSeason");
                IEnumerable<Character> results = _tvSeriesRepository.ListCharactersInSeason(season);

                if (results == null)
                {
                    Logger.Debug("No Characters found for this Season");
                    throw new HttpResponseException(HttpStatusCode.NoContent);
                }

                return results.Select(t => CharacterModel.CopyFrom(t));
            }
            catch (Exception err)
            {
                Logger.Error("Error in ListCharactersInSeason", err);
                throw;
            }
            finally
            {
                Logger.Trace("End => ListCharactersInSeason");
            }
        }
Esempio n. 2
0
        public IEnumerable <CharacterModel> ListCharactersInCulture(string name)
        {
            try
            {
                Logger.Trace("Begin => ListCharactersInCulture");
                Logger.DebugFormat("Parameters [name={0}]", name);

                IEnumerable <Character> results = _cultureRepository.ListCharactersInCulture(name);

                if (results == null)
                {
                    Logger.DebugFormat("Culture name={0} not found", name);
                    throw new HttpResponseException(HttpStatusCode.NotFound);
                }

                return(results.Select(t => CharacterModel.CopyFrom(t)));
            }
            catch (Exception err)
            {
                Logger.Error("Error in ListCharactersInCulture", err);
                throw;
            }
            finally
            {
                Logger.Trace("End => ListCharactersInCulture");
            }
        }