© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
23 replies
Sun

Class with same name as namespace

In the same app still (Ilanos), in my
Ilanos.Application
Ilanos.Application
proj I have a lot of classes that are supposed to use the
Joke
Joke
class.
However, for the sake of organization, I'm separating them like this:
|- Ilanos.Application
  |- Mappers
    |- Joke
|- Ilanos.Application
  |- Mappers
    |- Joke

The problem of that is the namespace name. The
JokeResponseMapper
JokeResponseMapper
, for example, would be at the namespace
Ilanos.Application.Mappers.Joke
Ilanos.Application.Mappers.Joke
while the
Joke
Joke
entity/model class is at
Ilanos.Core.Entities
Ilanos.Core.Entities
.
The compiler complains that the
Ilanos.Application.Mappers.Joke
Ilanos.Application.Mappers.Joke
namespace and the
Joke
Joke
class "have the same name", even if they're different, is there a way to keep the organization and have the named classes as they are?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Get full namespace name
C#CC# / help
3y ago
✅ Replace enum with class name
C#CC# / help
3y ago
Some namespace and class questions..
C#CC# / help
4y ago
How to access functions in another class in the same namespace?
C#CC# / help
11mo ago