Q: Confused about Blazor server default project I'm confused about Blazor server default project.
About two years ago, I tried Blazor server 5.0 template created by Microsoft in Visual Studio 2019.
I see project layout has a 3 subprojects:

*

*Blazor.Client contains the client side code

*Blazor.Server contains ASP.NET Core Web API

*Blazor.Share contains all shared data in 2 project above.

Now I need to create Blazor server project (version 7.0). When I created a project, there was only one project left.
And now, if we want to write something, we can write it in the initializeAsync method (database operation, file access etc.)
I want to know if this way is correct or not?
I don't need to write logic in Web API and use httpClient to request data, right?
Thanks for your answer, and sorry for my English.

A: 
About two years ago, I tried Blazor server 5.0 template created by
Microsoft in Visual Studio 2019. I see project layout has a 3
subprojects:Blazor.Client, Blazor.Server, Blazor.Share

You might misunderstand, The Blazor Server App template will build only one Blazor project. But the Blazor WebAssembly App template with selected the ASP.NET Core Hosted checkbox will generate a solution includes the following ASP.NET Core projects:

*

*"Client": The Blazor WebAssembly app.

*"Server": An app that serves the Blazor WebAssembly app and weather data to clients.

*"Shared": A project that maintains common classes, methods, and resources.

More detail information, see ASP.NET Core Blazor project structure.

if we want to write something, we can write it in the initializeAsync
method (database operation, file access etc.) I want to know if this
way is correct or not?

Yes, you can access the database or file in the OnInitializedAsync() method.

I don't need to write logic in Web API and use httpClient to request
data, right?

It depends on your choice, by using Web API, you can directly access the data from the API, instead of from the components/web page, if you don't want to provide this API, you can create service layer or directly access the database or file in the OnInitializedAsync() method. Refer to this article: Blazor Server App CRUD With Entity Framework Core In .Net 5.
