Exemple #1
0
        private SourceTypeId CheckSourceType()
        {
            SourceTypeId response = SourceTypeId.Api;
            string       uiHeader = Request.Headers["FromUI"].ToString();

            if (!String.IsNullOrWhiteSpace(uiHeader) && uiHeader.ToLower() == bool.TrueString.ToLower())
            {
                response = SourceTypeId.UI;
            }

            return(response);
        }
Exemple #2
0
 public IQueryable <MovieDTO> GetSingleMovie(long id, SourceTypeId source)
 {
     _displayService.AddDisplay(id, source);
     return(_moviesRepository.GetSingleMovie(id).ProjectTo <MovieDTO>(_mapper.ConfigurationProvider));
 }
Exemple #3
0
        public void AddDisplay(long movieId, SourceTypeId source)
        {
            DisplayDTO displayToAdd = new DisplayDTO(movieId, source);

            _displaysRepository.InsertDisplay(_mapper.Map <Display>(displayToAdd));
        }
Exemple #4
0
        public MovieDTO Get(long id)
        {
            SourceTypeId source = CheckSourceType();

            return(_movieService.GetSingleMovie(id, source).FirstOrDefault());
        }
 public DisplayDTO(long movieId, SourceTypeId source)
 {
     MovieId      = movieId;
     SourceTypeId = source;
     DisplayDate  = DateTime.Now;
 }