Skip to content

Feature: Override namespace #25

@enkelmedia

Description

@enkelmedia

The TS-namespace is based on the namespace of the C#-class which is probably a great default but it would be useful to be able to override the namespace for a class.

In my case I tend to organize all my C#-objects in "feature folders" but I'm not sure that I need the same structure for the namespaces in the front end project.

I guess this could be fixed with some kind of attribute on the class? It would also be nice to have some "global" override that would use the same namespace for all TypeScript-classes. Something like:

var ts = new TypeScriptGenerator();
ts.AddCSType(typeof(MyApp.Feature.Models.CustomerDto));
ts.SetNamespace("MyApp.Models");
var data = ts.ToString();

Same here, let me know if you would be interested in a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions