0

I struggle to understand, why a class with the partial modifier, can not contain classes that are not partial. They don't need to necessarily have their definition spread across multiple files.

Conversely, to me it makes more sense to require classes containing a partial class, to also be partial. But this is not the case, even though a class can't have definition in another class, without its parent class also being defined there.

Am I just not understanding partial correctly?

4
  • 3
    "why a class with the partial modifier, can not contain classes that are not partial" it can! Commented Apr 28, 2022 at 20:37
  • So, if a class is partial, and in contains a fully defined class, can I use that class in the other file? Commented Apr 28, 2022 at 20:54
  • Yes, see the link above. If you're having a specific problem, please edit the question and include the code that demonstrates that problem. Commented Apr 28, 2022 at 20:58
  • Thanks. I'm not currently near a computer, so editing would be hard, but that actually clears it up for me. Commented Apr 28, 2022 at 21:04

0

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.