I have c# file with all contents contained in a namespace LinkedList saved with the name linkedlist.cs . This file doesn't have a main() method. I want to include the content of that file or that namespace in another file.
How can I do that ?
I have c# file with all contents contained in a namespace LinkedList saved with the name linkedlist.cs . This file doesn't have a main() method. I want to include the content of that file or that namespace in another file.
How can I do that ?
Assuming your
LinkedListis in a project calledMyLinkedListProject, you will want to reference this project from the project inheriting it. As stated in the comments by @cdhowie you can then reference the namespace by adding theusing LinkedList;which will reference the namespace.Depending on the content of linkedlist.cs will depend on how you access it, assuming it contains a class called
LinkedListwithin theLinkedListyou would access the methods (of theclassusing code such asLinkedList.methodName();(this would work for astaticmethod, you'd have to instantiate aLinkedListfirst if you require an "instance of the object" for the method to work.