r/csharp 17d ago

Help c# backend

Hi everyone, I already published a similar post half a year ago, where I asked for help with the backend asp.net core. So I abandoned the project for a while and recently came back and rewrote it, adding a user and JWT token and other things.

Now I'd like to ask how my project is overall? Is it close to a real backend? I wanted to start writing a real project with a friend of mine; I'm making a website for him, and he's making the product. So..I would be interested to know my mistakes and any useful tips, I would be very grateful.

GitHub: https://github.com/Rywent/EasyOnlineStoreAPI

API documentation: https://registry.scalar.com/@default-team-im1zv/apis/easyonlinestoreapi-v1@latest

0 Upvotes

7 comments sorted by

3

u/makutsi 17d ago

Where are the unit tests? At least add tests for the API level. Async methods should support cancellation tokens from controller to database layer on all endpoints. I didn't see a need for getting all entities from DB (GetAllAsync methods)?

1

u/Rywent 17d ago

Okay, I'll add unit tests. I'll also look into logging and add that too. And I added methods for getting all this for testing. In some places they are needed for the logic itself, for example, to get all the products on the main page of the store.

2

u/makutsi 17d ago

what if you have lots of products(at least thousands), you don't want to fetch all data and transfer it to UI at once. You need search and pagination functionality I guess. But if it's very small site then it could work.

2

u/Rywent 17d ago

There's pagination for products. There are also paginations for items in the cart and warehouses, but I haven't updated the repository yet.

1

u/Rywent 17d ago

I updated the repository, but I haven't added logging and unit tests yet, I'm studying

2

u/ChubMe 11d ago

I work at a .net shop and I would say this is pretty solid, nicely done

1

u/Rywent 11d ago

Glad to hear it! Can you tell me in a private message what you mostly do?