Answer the question
In order to leave comments, you need to log in
Where is the entry point in C# used?
I started to study programming, before that I did not learn anything except pure C.
The first thing I saw in Blazor is a file called Entry Point
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace BlazorApp
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
using
- as I understand it, how in C the directive for the Inсlude preprocessor is only called differently?
Answer the question
In order to leave comments, you need to log in
Detailed explanation from the documentation
Briefly:
using
- kind of Include, but not really.
namespace
- just what using adds to the current file (otherwise you would have to write full names like Microsoft.Extensions.Hosting.IHostBuilder
). I think you can consider it (namespace) as an analogue of a folder
public class Program
- declaring a public class (only because in C # you can’t immediately start writing code without declaring the Main method, and a method cannot be declared without a class - in C # 9 it will be possible, but it doesn’t matter)
public static void Main(string[] args)
- An analogue from the sishny void main(int argc, char* argv[])
Since you have such questions, it’s too early for you to climb into Blazor
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question