© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•10mo ago•
10 replies
Faker

✅ namespace and using keyword in C#

Hello guys, I have a quick question. I don't understand, when do we use the
using
using
keyword and the
namespace
namespace
keyword... can they be used interchangeably ? (don't remember if I once saw a namespace along with a library name... is that even allowed?) .

Now, the namespace, sometimes I saw something like that:
namespace {...}
namespace {...}
like we have the curly braces but sometimes we don't. My IDE always do the heavy lifting but I wanted to understand what the syntax is :c.

Do we use the keyword
using
using
when we need to use certain libraries? While the keyword
namespace
namespace
is used to related to certain folders/cs files? I'm a bit confused here :c... what about the
namespace {...}
namespace {...}
syntax please

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore.Diagnostics;

namespace MainProject.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore.Diagnostics;

namespace MainProject.Context;
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

ref keyword in C#
C#CC# / help
13mo ago
✅ using keyword for resource management in C#
C#CC# / help
12mo ago
IDisposable and using keyword?
C#CC# / help
2y ago
using Namespace; (Problem)
C#CC# / help
3y ago