コード例 #1
0
        public static IEnumerable <IEnumModel> GetEnumModels(this SoftwareFactory.Engine.IMetaDataManager metaDataManager, SoftwareFactory.Engine.IApplication application, string metadataIdentifier = null)
        {
            if (!string.IsNullOrWhiteSpace(metadataIdentifier))
            {
                return(metaDataManager.GetMetaData <IEnumModel>(new MetaDataIdentifier(metadataIdentifier)).Where(x => x.Application.Name == application.ApplicationName).ToList());
            }

            return(new IEnumModel[0]
                   .Concat(metaDataManager.GetMetaData <IEnumModel>(new MetaDataIdentifier("Domain")).Where(x => x.Application.Name == application.ApplicationName))
                   .Concat(metaDataManager.GetMetaData <IEnumModel>(new MetaDataIdentifier("Services")).Where(x => x.Application.Name == application.ApplicationName))
                   .ToList());
        }
コード例 #2
0
        public static IEnumerable <IDTOModel> GetDTOModels(this SoftwareFactory.Engine.IMetaDataManager metaDataManager, SoftwareFactory.Engine.IApplication application, string metadataIdentifier = "Services")
        {
            var result = metaDataManager.GetMetaData <IDTOModel>(new MetaDataIdentifier(metadataIdentifier ?? "Services")).Where(x => x.Application.Name == application.ApplicationName).ToList();

            if (result.Any())
            {
                return(result);
            }

            // Purely for backward compatibility between 1.5.x and 1.6.x
            return(metaDataManager.GetMetaData <IDTOModel>(new MetaDataIdentifier("DTO")).Where(x => x.Application.Name == application.ApplicationName).ToList());
        }