/// <summary>
        /// Gets the graph.
        /// </summary>
        public GraphWithTabularCompare <Platform, PlatformType> GetGraphWithPlatformCompare(Guid graphGuid, Guid applicationId,
                                                                                            DateTime dateStart, DateTime dateEnd)
        {
            GraphWithTabularCompare <Platform, PlatformType> graphWithPlatformCompare =
                new GraphWithTabularCompare <Platform, PlatformType>();

            try
            {
                Application applicationMain = this.applicationRepository.Find(applicationId);

                IEnumerable <PlatformType> platformIdsToCompare = applicationMain.Platforms.Select(x => x.Type);
                IEnumerable <Platform>     platformsToCompare   = this.platformRepository.FindAll();
                platformsToCompare = platformsToCompare.Where(x => platformIdsToCompare.Contains(x.Type)).ToList();

                if (platformsToCompare.Count() != 0)
                {
                    graphWithPlatformCompare.Options  = platformsToCompare.ToList();
                    graphWithPlatformCompare.Selected = platformsToCompare.Select(x => x.Type).Take(2).ToList();

                    graphWithPlatformCompare.Consume
                    (
                        this.GetGraphPlatform
                        (
                            graphGuid,
                            applicationId,
                            graphWithPlatformCompare.Selected,
                            dateStart,
                            dateEnd
                        )
                    );

                    graphWithPlatformCompare.Tabular = graphWithPlatformCompare.Data.Series;
                }
                else
                {
                    graphWithPlatformCompare.NotEnoughData = true;
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new ServiceLayerException(ex);
            }

            return(graphWithPlatformCompare);
        }
        /// <summary>
        /// Gets the graph with application compare.
        /// </summary>
        public GraphWithTabularCompare <ApplicationMeta, Guid> GetGraphWithApplicationCompare(Guid graphGuid, Guid applicationId,
                                                                                              DateTime dateStart, DateTime dateEnd)
        {
            GraphWithTabularCompare <ApplicationMeta, Guid> graphWithApplicationCompare =
                new GraphWithTabularCompare <ApplicationMeta, Guid>();

            try
            {
                Application applicationMain = this.applicationRepository.Find(applicationId);

                IEnumerable <Application> applicationsToCompare = this.applicationRepository.FindAll();
                applicationsToCompare = applicationsToCompare.Where(x => x.Guid != applicationMain.Guid).ToList();

                List <ApplicationMeta> applications = new List <ApplicationMeta>();
                if (applicationsToCompare.Count() != 0)
                {
                    applications = applicationsToCompare.Cast <ApplicationMeta>().ToList();
                }
                applications.Add(applicationMain);
                graphWithApplicationCompare.Options = applications;


                List <Guid> applicationsSelected = new List <Guid>();
                if (applicationsToCompare.Count() != 0)
                {
                    applicationsSelected = applicationsToCompare.Select(x => x.Guid).Take(2).ToList();
                }
                applicationsSelected.Add(applicationId);
                graphWithApplicationCompare.Selected = applicationsSelected;

                graphWithApplicationCompare.Consume(
                    this.GetGraphApplications(graphGuid, applicationId, applicationsSelected, dateStart, dateEnd)
                    );
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new ServiceLayerException(ex);
            }

            return(graphWithApplicationCompare);
        }
        /// <summary>
        /// Gets the graph.
        /// </summary>
        public GraphWithTabularCompare <string, string> GetGraphWithVersionsCompare(Guid graphGuid, Guid applicationId,
                                                                                    DateTime dateStart, DateTime dateEnd)
        {
            GraphWithTabularCompare <string, string> graphWithVersionCompare =
                new GraphWithTabularCompare <string, string>();

            try
            {
                graphWithVersionCompare.Options = this.applicationRepository.GetVersionsByApplication(applicationId).ToList();

                if (graphWithVersionCompare.Options.Count() != 0)
                {
                    graphWithVersionCompare.Selected = graphWithVersionCompare.Options.Take(3).ToList();
                    graphWithVersionCompare.Consume(
                        this.GetGraphVersions(graphGuid, applicationId, graphWithVersionCompare.Selected, dateStart, dateEnd)
                        );

                    graphWithVersionCompare.Tabular = graphWithVersionCompare.Data.Series;
                }
                else
                {
                    graphWithVersionCompare.NotEnoughData = true;
                }
            }
            catch (DataAccessLayerException)
            {
                throw;
            }
            catch (ServiceLayerException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new ServiceLayerException(ex);
            }

            return(graphWithVersionCompare);
        }