public void NativeTypes_FiltersExpectedTypes() { var nativeTypes = new NativeTypesFeature(); var result = Types.Concat(nativeTypes.MetadataTypesConfig.ExportTypes) .Concat(new[] {typeof(Test5)}) .WithoutNativeTypes(nativeTypes); result.Should().BeEquivalentTo(Types); }
public CSharpGenerator(MetadataTypesConfig config) { Config = config; feature = HostContext.GetPlugin<NativeTypesFeature>(); }
public SwiftGenerator(MetadataTypesConfig config) { Config = config; feature = HostContext.GetPlugin<NativeTypesFeature>(); AllTypes = new List<MetadataType>(); }
public TypeScriptGenerator(MetadataTypesConfig config) { Config = config; feature = HostContext.GetPlugin <NativeTypesFeature>(); }
public SwiftGenerator(MetadataTypesConfig config) { Config = config; feature = HostContext.GetPlugin <NativeTypesFeature>(); AllTypes = new List <MetadataType>(); }
/// <summary> /// Filters out ServiceStack native type namespaces and types /// </summary> /// <param name="types">the types to filter</param> /// <param name="nativeTypes">the NativeTypesFeature</param> /// <returns>the filtered types</returns> public static IEnumerable <Type> WithoutNativeTypes(this IEnumerable <Type> types, NativeTypesFeature nativeTypes) { return(nativeTypes == null ? types : types .Where(x => !nativeTypes.MetadataTypesConfig.IgnoreTypes.Contains(x)) .Where(x => !nativeTypes.MetadataTypesConfig.IgnoreTypesInNamespaces.Contains(x.Namespace))); }
public GrpcProtoGenerator(MetadataTypesConfig config) { Config = config; feature = HostContext.AssertPlugin <NativeTypesFeature>(); grpc = HostContext.AssertPlugin <GrpcFeature>(); }