/// <summary>
        /// Initializes a new instance of the <see cref="OrganizationSnapshot"/> class.
        /// </summary>
        /// <param name="connectionDetail">Object holding connection details to given organization.</param>
        /// <param name="reference">
        /// Instance of the <see cref="OrganizationSnapshot"/> class, serving as refenece. Only
        /// these solutions and assemblies will be included, that are already present in the reference.
        /// </param>
        public OrganizationSnapshot(ConnectionDetail connectionDetail, OrganizationSnapshot reference)
        {
            Solution[] solutions = null;
            PluginAssembly[] assemblies = null;
            DataCollection<Entity> entities = null;

            var organizationService = connectionDetail.GetOrganizationService();

            try
            {
                entities = organizationService.RetrieveMultiple(Helpers.CreateSolutionsQuery()).Entities;
                solutions = entities.ToArray<Entity>().Select(x => new Solution(x)).ToArray<Solution>();
                solutions = solutions.Where(x => reference.Solutions.Where(y => y.UniqueName == x.UniqueName).Count() > 0).ToArray<Solution>();

                entities = organizationService.RetrieveMultiple(Helpers.CreateAssembliesQuery()).Entities;
                assemblies = entities.ToArray<Entity>().Select(x => new PluginAssembly(x)).ToArray<PluginAssembly>();
                assemblies = assemblies.Where(x => reference.Assemblies.Where(y => y.UniqueName == x.UniqueName).Count() > 0).ToArray<PluginAssembly>();
            }
            catch (Exception ex)
            {
                // Hiding exceptions
            }

            this.ConnectionDetail = connectionDetail;
            this.Solutions = solutions;
            this.Assemblies = assemblies;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OrganizationSnapshot"/> class.
        /// </summary>
        /// <param name="connectionDetail">Object holding connection details to given organization.</param>
        public OrganizationSnapshot(ConnectionDetail connectionDetail)
        {
            var organizationService = connectionDetail.GetOrganizationService();

            this.ConnectionDetail = connectionDetail;
            this.Solutions = organizationService.RetrieveMultiple(Helpers.CreateSolutionsQuery()).Entities.Select(x => new Solution(x)).ToArray<Solution>();
            this.Assemblies = organizationService.RetrieveMultiple(Helpers.CreateAssembliesQuery()).Entities.Select(x => new PluginAssembly(x)).ToArray<PluginAssembly>();
        }