tommy
✅ What is the use of `LogLevel` type in C#?
I have also tried to use this type by adding the
using Microsoft.Extensions.Logging;
directive, but this shows me an error that the Extensions
type does not exist in the Microsoft
namespace. How to use this then?10 replies
✅ Difference between `string[]` and `IEnumerable<string>`
in the following the code, the output seems to be the same:
i know that
enum
s are used to define a set of exhaustive types, and are closely related to int
s.
but what does it mean to have IEnumerable<string>
and how different is it from string[]
?23 replies
✅ Having trouble going from the old syntax to top level statements
i have been learning C# using the old syntax. i do not know the name for it, but this is what it is:
but now that i have started working on Visual Studio, i am having a hard time learning what is the meaning of top level statements. So, how to think about this, considering that i have learnt my basics over Notepad?
9 replies
Why do we enclose the `Main` function inside of a class in C#?
After learning C++, I think it makes sense to include the
main
function outside of a class. Why do we not do it in C#?
Like what disadvantage I would have by not including the main
function in a class in C++? Would it be accessible to everyone? Does including the Main
method in a class in C# make it "safer" than it being present at a global scope? What is the reason behind this?9 replies