© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
5 replies
Acetylene

Blazor WebAssembly API Controller

Hi all, I am pretty new in C#. Now, I'm working on a Blazor web project. My project structure is like that:
|
MealOrdering
MealOrdering
(Blazor WebAssembly) ( MealOrdering.Server.Data and MealOrdering.Shared added as dependent projects)
|
MealOrdering.Server.Data
MealOrdering.Server.Data
(Class Library)
|
MealOrdering.Shared
MealOrdering.Shared
(Class Library)

I created models in
MealOrdering.Server.Data
MealOrdering.Server.Data
, DTOs in
MealOrdering.Shared
MealOrdering.Shared
, services in
MealOrdering
MealOrdering
. Also added AutoMapper package to
MealOrdering
MealOrdering
and created
Services/Extensions/ConfigureMappingExtension.cs
Services/Extensions/ConfigureMappingExtension.cs
.
Finally, in
MealOrdering
MealOrdering
, I created a folder which is named
Controllers
Controllers
and a API Controller which is named
UserController.cs
UserController.cs
. I added a method for handling GET request.
[HttpGet("Users")]
public async Task<ServiceResponse<List<UserDTO>>> GetUsers()
{
    return new ServiceResponse<List<UserDTO>>
    {
        Value = await userService.GetUsers()
    };
}
[HttpGet("Users")]
public async Task<ServiceResponse<List<UserDTO>>> GetUsers()
{
    return new ServiceResponse<List<UserDTO>>
    {
        Value = await userService.GetUsers()
    };
}


However, when I go to
https://localhost:44325/api/User/Users
https://localhost:44325/api/User/Users
, it returns Not Found... What should I do to get users?

Project structure has been attached.

I tried my best so hope it's clear to get help.
image.png
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

❔ Blazor Webassembly
C#CC# / help
3y ago
❔ Blazor WebAssembly CSS
C#CC# / help
3y ago
blazor webassembly and web api image file upload
C#CC# / help
2y ago
Blazor WebAssembly can't load
C#CC# / help
2y ago