Global Usings in C# 10 and .NET 6 In 10 Minutes or Less

preview_player
Показать описание
In C# 10, we have the ability to set global using in our application. See how in this 10-Minute Training video.

Рекомендации по теме
Комментарии
Автор

Thank you for being such a vital member of the .NET community. I am going to purchase your docker course just to support you.

BrokenSword
Автор

Ok fine, I'll update to .NET 6...

AQDuck
Автор

Adding this to code reminds me of the old days in COBOL, with “Library Statements.” “‘Using’ that Library, gave you access to everything in it.”
Yep! Thanks, Tim! I can’t wait to use it in Class! (I love these short insights, BTW!)

williamFrSFO
Автор

Thanks for the lesson. I absorbed more from this than the messy tech docs covering this topic.

I'll definitely use this when we move to 6. It might be nice to constrain your global usings to a namespace to allow better control.

quin
Автор

Thanks for the lesson. Good feature to use for simple file headers but explicit using statements at the top of my files shows me a summary of what I have been doing in my files.

mrsajjad
Автор

I will 100% use it. You forgot to mention about declaring or removing global using from inside the csproj file.

metaltyphoon
Автор

Great video, exactly what I am looking for. A big appreciated from Vietnam to you, man. Keeps doing those quick content like this.

edragon
Автор

Thanks Tim, 10 Mins Videos are very helpful. The in-depth videos are awesome.

tosinakinyemi
Автор

That’s so cool, love the new features, great thanks for sharing it. Well done Tim.

goodmanshawnhuang
Автор

Great Video
When I do WPF/ MVVM development, I put all my global using's on my main ViewModel file. That way I don't have to create a extra file. I love this feature, it saves a lot of time, I don't have do a bunch of using statements to import my libary to the project.

ABMedia
Автор

Literally makes me so giddy! I just wish Microsoft would create documentation explaining the project template changes in detail.

justinian.erdmier
Автор

I really like these 10 Minutes or Less series. Thanks Tim!

georgeti
Автор

That's gonna be really helpful. Can't wait to start using it already. Thanks for another cool tutorial.

NAELSLR
Автор

Hello, another great material, I'm waiting for more. I understand that this new "global using" is optional? It seems to me that the standard approach helps to avoid namespace errors. If this approach is not required, I will stick to the old one.

krzysztofzon
Автор

You missed one important part:
You can put: <Using Remove="System.Windows.Forms" /> into the project files, which removes some of the default global usings that might cause issues.

GnomeEU
Автор

I hope they don't break the whole language with these rapid changes. With the aid of IDEs these days we shouldn't have to be considered with typing multiple extra characters rather than be sure that the code is safe in the long run, which is what the C# was about

nimaghomri
Автор

Thanks for showing this. I probably will not use it. For me it is OK to see explicitly all dependencies between namespaces you create in an application. Shorter code is not always better code.

HollandHiking
Автор

Okay, this one I am 100% onboard with -- and about bloody time too! This will make things sooo much easier to manager! instead of having to add using statements all over the board. This I will absolutely be using. It speaks right into my Autistic Universe. lol

TheAngelOfDeath
Автор

I haven't been following the evolution of C# recently, but noticed a few other nice syntactic changes in your video. The omission of an explicit Program class and main function makes a lot of sense to me.
Thanks for the explanation!

ISKLEMMI
Автор

Seems like a good ideea in a Razor pages project where you need to use different data coming from idk a data layer

andreeapurta