0

To preface, I need to say that I am still in the learning stagings of asp.net

I need to create a custom namespace where I can place my DataObject.cs file
The namespace is .Components.Data

How do I go about doing this?

Thanks in advance

1 Answer 1

1

Put your class inside a namespace Components.Data { ... } block.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. So there is no folder structure related to the namespace? Meaning the DataObject.cs file does not need to be in a folder called Data, which is inside a folder called Components?
Nope - you can have whatever folder structure you want in the project, it's independent of the namespace. If you add a folder and a file, Visual Studio may infer the namespace based on the folder structure, but you're not required to have folders to match the namespaces.
@CSharp: It can be, if you want to. If it is, VS will automatically put in the namespace block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.