internal MovieMetaMovieModel ConvertModel(BasicResultModel inputModel) { var metaEnginge = _apiOptions.ApiReferenceKey; var year = ""; try { year = DateTime.Parse(inputModel.ReleaseDate).Year.ToString(); } catch (Exception ex) { Console.WriteLine(ex.Message); } return(new MovieMetaMovieModel() { ImgUrl = JoinImagePath(inputModel.PosterPath), BackgroundImgUrl = JoinImagePath(inputModel.BackdropPath), Plot = inputModel.Overview, MetaEngine = metaEnginge, Title = inputModel.Title, OriginalTitle = inputModel.OrginalTitle, Reference = $"{metaEnginge}:{inputModel.Id.ToString()}", Rating = inputModel.VoteAverage.ToString(), Year = year }); }
public BasicResultModel ByTaxId(string taxId) { Guid correlationId = Guid.NewGuid(); Stopwatch watch = Stopwatch.StartNew(); logger.Debug($"{correlationId} - Search Basic Data for taxId:{taxId} started"); CompanyBasicProvider provider = new CompanyBasicProvider(correlationId); BasicResultModel result; try { result = provider.GetCompanyByTaxId(taxId); } catch (Exception e) { logger.Error($"{correlationId} - Error appeared: {e}"); result = new BasicResultModel { Error = "Request failed" }; return(result); } logger.Debug($"{correlationId} - Search Basic Data ended. Time:{watch.Elapsed}"); result.TimeTaken = watch.Elapsed; return(result); }
public BasicResultModel GetCompanyByTaxId(string taxId) { Logger.Debug($"{CorrelationId} - Request Basic Data for taxId:{taxId} started"); Stopwatch watch = Stopwatch.StartNew(); Ares_odpovedi aresResponse = WebRequestHelper.XmlWebRequestSequence <Ares_odpovedi>( PrepareUrl(new Dictionary <string, string> { { "ico", taxId } }) ); Logger.Debug($"{CorrelationId} - Got Response from ARES. Time:{watch.Elapsed}"); watch.Restart(); BasicResultModel result = BaseMapper.MapBasicData(aresResponse); Logger.Debug($"{CorrelationId} - ARES response mapped. Time:{watch.Elapsed}"); return(result); }
internal MovieMetaMovieModel ConvertModel(BasicResultModel inputModel) { return(new MovieMetaMovieModel() { ImgUrl = JoinImagePath(inputModel.PosterPath), BackgroundImgUrl = JoinImagePath(inputModel.BackdropPath), Plot = inputModel.Overview, MetaEngine = _apiOptions.ApiReferenceKey, Title = inputModel.Title, OriginalTitle = inputModel.OrginalTitle, Reference = inputModel.Id.ToString(), Rating = inputModel.VoteAverage.ToString() }); }