Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on Is it possible to re-export types similar to JS?
Post
Is it possible to re-export types similar to JS?
I'm writing a library "MyLibrary".
In there, I group code into sections that make sense.
Let's say I have a folder "Reports" and a folder "Helpers".
I would like to have my code separated while working on it, but would like my users to just import "MyLibrary" and have all the important stuff together there.
In JS, I would be able to roughly do this:
import ReportFactory from './Reports/ReportFactory';
import StringHelper from './Helpers/StringHelper';
export {ReportFactory, StringHelper}
Is something like this possible in C#?
I know I could keep the files under that path, while letting them have a different namespace, but that's very hacky and I'd rather not, then.
So far I have stumbled on type forwarding, but that redirects to another assembly while keeping the namespace the same.
Is there a way to make such a "summary" namespace for the users of my library?
1 comment thread