示例#1
0
        public IEnumerable <AssemblyData> Get()
        {
            // Convention based location of profiles (backwards compatibility)
            var legacyProfilePath = _codeRepositoryProvider.GetResolvedCodeRepositoryByName(
                CodeRepositoryConventions.Implementation,
                CodeRepositoryConventions.Application);

            var assemblyData = Directory.GetFiles(
                legacyProfilePath,
                ProfilesSearchString,
                SearchOption.AllDirectories)
                               .Select(
                x => new AssemblyData
            {
                Path         = Path.GetDirectoryName(x),
                TemplateSet  = TemplateSetConventions.Profile,
                AssemblyName = _assemblyDataHelper.GetAssemblyName(x),
                IsProfile    = true,
                IsExtension  = false,
                SchemaName   = EdFiConventions.ProperCaseName
            }).ToList();

            assemblyData.ForEach(x => _logger.Debug($"Found file matching '{ProfilesSearchString}' at '{x.Path}'"));

            return(assemblyData);
        }
        public IEnumerable <AssemblyData> Get()
        {
            // Convention based location of extensions (backwards compatibility)
            var legacyExtensionPath = _codeRepositoryProvider.GetResolvedCodeRepositoryByName(
                CodeRepositoryConventions.Implementation,
                CodeRepositoryConventions.Application);

            var assemblyData = Directory.GetFiles(
                legacyExtensionPath,
                ExtensionsSearchString,
                SearchOption.AllDirectories)
                               .Select(
                x =>
            {
                string assemblyName = _assemblyDataHelper.GetAssemblyName(x);

                string schemaName = ExtensionsConventions.GetProperCaseNameForLogicalName(
                    _domainModelsDefinitionsProvidersByProjectName[assemblyName]
                    .GetDomainModelDefinitions()
                    .SchemaDefinition
                    .LogicalName);

                return(new AssemblyData
                {
                    Path = Path.GetDirectoryName(x),
                    TemplateSet = TemplateSetConventions.Extension,
                    AssemblyName = assemblyName,
                    IsExtension = true,
                    IsProfile = false,
                    SchemaName = schemaName
                });
            }).ToList();

            assemblyData.ForEach(x => _logger.Debug($"Found file matching '{ExtensionsSearchString}' at '{x.Path}'"));

            return(assemblyData);
        }