Add support for generating all classes in namspace

Issue #102 new
Former user created an issue

All our model classes are in the same namespace

Company.App.Web.Data.Models

We want all our models to have a typescript definition

Would it not be nice with a

.ForNamespace(string namespacePath) 

method?

Comments (1)

  1. Unknown Name

    Ah, solved it:

    <#@ assembly name="$(TargetDir)Company.App.Web.Data.dll" #>
    <#
    var ts = TypeScript.Definitions();
    var types = AppDomain.CurrentDomain.GetAssemblies()
                            .SelectMany(t => t.GetTypes())
                            .Where(t => t.IsClass && t.Namespace == "Company.App.Web.Data.Models");
    foreach(var type in types)
    {
        ts = ts.For(type);
    }
    
    #>
    <#= ts.Generate(TsGeneratorOutput.Properties) #>
    
  2. Log in to comment