GetMetadataTypes() public méthode

public GetMetadataTypes ( IRequest req, MetadataTypesConfig config = null, bool>.Func predicate = null ) : MetadataTypes
req IRequest
config MetadataTypesConfig
predicate bool>.Func
Résultat MetadataTypes
        public object Any(TypesSwift request)
        {
            request.BaseUrl = GetBaseUrl(request.BaseUrl);

            var typesConfig = NativeTypesMetadata.GetConfig(request);

            //Include SS types by removing ServiceStack namespaces
            if (typesConfig.AddServiceStackTypes)
            {
                typesConfig.IgnoreTypesInNamespaces = new List <string>();
            }

            ExportMissingSystemTypes(typesConfig);

            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);

            metadataTypes.Types.RemoveAll(x => x.Name == "Service");

            try
            {
                var swift = new SwiftGenerator(typesConfig).GetCode(metadataTypes, base.Request);
                return(swift);
            }
            catch (System.Exception)
            {
                throw;
            }
        }
        public object Any(TypesSwift request)
        {
            request.BaseUrl = GetBaseUrl(request.BaseUrl);

            var typesConfig = NativeTypesMetadata.GetConfig(request);

            //Include SS types by removing ServiceStack namespaces
            if (typesConfig.AddServiceStackTypes)
            {
                typesConfig.IgnoreTypesInNamespaces = new List <string>();
            }

            ExportMissingSystemTypes(typesConfig);

            //Swift doesn't support generic protocols (requires Type modification)
            typesConfig.ExportTypes.Remove(typeof(ICreateDb <>));
            typesConfig.ExportTypes.Remove(typeof(IUpdateDb <>));
            typesConfig.ExportTypes.Remove(typeof(IPatchDb <>));
            typesConfig.ExportTypes.Remove(typeof(IDeleteDb <>));
            typesConfig.ExportTypes.Remove(typeof(ISaveDb <>));

            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);

            metadataTypes.Types.RemoveAll(x => x.Name == "Service");

            try
            {
                var swift = new SwiftGenerator(typesConfig).GetCode(metadataTypes, base.Request);
                return(swift);
            }
            catch (System.Exception)
            {
                throw;
            }
        }
        public MetadataTypes Any(TypesMetadata request)
        {
            request.BaseUrl = GetBaseUrl(request.BaseUrl);

            var typesConfig   = NativeTypesMetadata.GetConfig(request);
            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);

            return(metadataTypes);
        }
        public object Any(TypesVbNet request)
        {
            request.BaseUrl = GetBaseUrl(request.BaseUrl);

            var typesConfig   = NativeTypesMetadata.GetConfig(request);
            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);
            var vbnet         = new VbNetGenerator(typesConfig).GetCode(metadataTypes, base.Request);

            return(vbnet);
        }
        public object Any(TypesFSharp request)
        {
            request.BaseUrl = GetBaseUrl(request.BaseUrl);

            var typesConfig   = NativeTypesMetadata.GetConfig(request);
            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);
            var fsharp        = new FSharpGenerator(typesConfig).GetCode(metadataTypes, base.Request);

            return(fsharp);
        }
        private MetadataTypes ConfigureScript(MetadataTypesConfig typesConfig)
        {
            //Include SS types by removing ServiceStack namespaces
            if (typesConfig.AddServiceStackTypes)
            {
                typesConfig.IgnoreTypesInNamespaces = new List <string>();
            }

            typesConfig.ExportTypes.Add(typeof(KeyValuePair <,>));
            typesConfig.ExportTypes.Add(typeof(Tuple <>));
            typesConfig.ExportTypes.Add(typeof(Tuple <,>));
            typesConfig.ExportTypes.Add(typeof(Tuple <, ,>));
            typesConfig.ExportTypes.Add(typeof(Tuple <, , ,>));
            typesConfig.ExportTypes.Remove(typeof(IMeta));


            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);

            metadataTypes.Types.RemoveAll(x => x.Name == "Service");

            var returnInterfaces = new List <Type>(ReturnInterfaces);

            if (typesConfig.AddServiceStackTypes)
            {
                //IReturn markers are metadata properties that are not included as normal interfaces
                var generator = ((NativeTypesMetadata)NativeTypesMetadata).GetGenerator(typesConfig);

                var allTypes     = metadataTypes.GetAllTypesOrdered();
                var allTypeNames = allTypes.Select(x => x.Name).ToHashSet();
                foreach (var type in allTypes)
                {
                    foreach (var typeName in type.Implements.Safe())
                    {
                        var iface = BuiltinInterfaces.FirstOrDefault(x => x.Name == typeName.Name);
                        if (iface != null && !allTypeNames.Contains(iface.Name))
                        {
                            returnInterfaces.AddIfNotExists(iface);
                        }
                    }
                }
                metadataTypes.Types.InsertRange(0, returnInterfaces.Map(x => generator.ToType(x)));
            }

            return(metadataTypes);
        }
        public object Any(TypesKotlin request)
        {
            request.BaseUrl = GetBaseUrl(request.BaseUrl);

            var typesConfig = NativeTypesMetadata.GetConfig(request);

            //Include SS types by removing ServiceStack namespaces
            if (typesConfig.AddServiceStackTypes)
            {
                typesConfig.IgnoreTypesInNamespaces = new List <string>();
            }

            ExportMissingSystemTypes(typesConfig);

            var metadataTypes = NativeTypesMetadata.GetMetadataTypes(Request, typesConfig);

            metadataTypes.Types.RemoveAll(x => x.Name == "Service");

            var java = new KotlinGenerator(typesConfig).GetCode(metadataTypes, base.Request, NativeTypesMetadata);

            return(java);
        }