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); }
public IQueryable <MovieDTO> GetSingleMovie(long id, SourceTypeId source) { _displayService.AddDisplay(id, source); return(_moviesRepository.GetSingleMovie(id).ProjectTo <MovieDTO>(_mapper.ConfigurationProvider)); }
public void AddDisplay(long movieId, SourceTypeId source) { DisplayDTO displayToAdd = new DisplayDTO(movieId, source); _displaysRepository.InsertDisplay(_mapper.Map <Display>(displayToAdd)); }
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; }