Ejemplo n.º 1
0
        /// <summary>
        ///     Load entities.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public IEnumerable <EntityEntry> GetEntities(IProcessingContext context)
        {
            if (string.IsNullOrEmpty(ActiveSolution))
            {
                throw new InvalidOperationException("No 'ActiveSolution' has been specified.");
            }

            /////
            // Get all entities.
            /////
            IEnumerable <Entity> allEntities = Entities.Concat(SchemaResolver.GetImpliedRelationshipEntites( ));

            /////
            // Get the entities that belong to the active solution.
            /////
            IEnumerable <Entity> activeSolutionEntities = allEntities.Where(e => e.Members.Any(m => m.MemberDefinition.Alias.Namespace == "core" && m.MemberDefinition.Alias.Value == "inSolution" && m.Value == ActiveSolution));

            return(activeSolutionEntities.Select(e => new EntityEntry
            {
                EntityId = e.Guid,
                State = DataState.Added
            }));
        }