Esempio n. 1
0
        /// <summary>
        /// Returns true if an <see cref="ObjectImport"/> has been declared for the given shared object identified by it's <paramref name="sharingUID"/>
        /// </summary>
        /// <param name="sharingUID"></param>
        /// <returns></returns>
        public bool IsImported(string sharingUID)
        {
            //empty guids are never imported
            if (Guid.Empty.ToString().Equals(sharingUID))
            {
                return(false);
            }

            return(_catalogueRepository.GetAllObjectsWhere <ObjectImport>("SharingUID", sharingUID).Any());
        }
Esempio n. 2
0
 /// <summary>
 /// Returns all <see cref="ExtendedProperty"/> defined <paramref name="forObject"/> in the <paramref name="repository"/>
 /// </summary>
 /// <param name="repository"></param>
 /// <param name="forObject"></param>
 /// <returns></returns>
 internal static IEnumerable <ExtendedProperty> GetProperties(ICatalogueRepository repository, IMapsDirectlyToDatabaseTable forObject)
 {
     return(repository.GetAllObjectsWhere <ExtendedProperty>(
                "ReferencedObjectID", forObject.ID,
                System.Linq.Expressions.ExpressionType.And,
                "ReferencedObjectType", forObject.GetType().Name)
            .Where(p => p.IsReferenceTo(forObject)));
 }
        internal JoinableCohortAggregateConfigurationUse(ICatalogueRepository repository, AggregateConfiguration user, JoinableCohortAggregateConfiguration joinable)
        {
            if (repository.GetAllObjectsWhere <JoinableCohortAggregateConfiguration>("AggregateConfiguration_ID", user.ID).Any())
            {
                throw new NotSupportedException("Cannot add user " + user + " because that AggregateConfiguration is itself a JoinableCohortAggregateConfiguration");
            }

            if (user.AggregateDimensions.Count(u => u.IsExtractionIdentifier) != 1)
            {
                throw new NotSupportedException("Cannot configure AggregateConfiguration " + user + " as join user because it does not contain exactly 1 IsExtractionIdentifier dimension");
            }

            repository.InsertAndHydrate(this, new Dictionary <string, object>()
            {
                { "JoinableCohortAggregateConfiguration_ID", joinable.ID },
                { "AggregateConfiguration_ID", user.ID },
                { "JoinType", ExtractionJoinType.Left.ToString() }
            });
        }
Esempio n. 4
0
 public FavouritesProvider(IBasicActivateItems activator)
 {
     _activator           = activator;
     _catalogueRepository = _activator.RepositoryLocator.CatalogueRepository;
     CurrentFavourites    = _catalogueRepository.GetAllObjectsWhere <Favourite>("Username", Environment.UserName).ToList();
 }