C
C#5mo ago
Tantrim

Solution Architecture Question

I'm going to create a new solution but I want to make sure I have a good/best practices architecture. One of my main focus's for this solution is to learn about these technologies so I'm not overly concerned with using other technologies even if those might be best practice. technologies I want to use: 1. Blazor - "Blazor Web App" template 2. Entity Framework 3. SQLite The app will be calling a 3rd party API to retrieve data (no POST) and save that to a local DB. I want to then manipulate the data and have different dashboards on that data. It's nothing complex, I just want to start down the correct path. So I guess my main question is, what projects should I be using to build this small app.
7 Replies
Jimmacle
Jimmacle5mo ago
by what projects do you mean how to structure your solution? start with one project, only split it up if the complexity calls for it
Tantrim
TantrimOP5mo ago
should this solution only need 2 projects? Front end and middle layer that calls the API?
Jimmacle
Jimmacle5mo ago
depending on your blazor hosting model it could even be 1 if you aren't using wasm 1 project is fine i have a whole ERP system at work that's 1 project
Tantrim
TantrimOP5mo ago
I think I will make a class library and put the business logic in there at least how is the data layer typically handled? I guess between the DB and calling api is my question
Jimmacle
Jimmacle5mo ago
personally i'd have endpoint -> handler/service -> db
Angius
Angius5mo ago
I have handler (also being the endpoint, thanks Immediate.Apis) -> database If you call some 3rd party API, well, it depends when But if you want to save that in the database, I say just do it in the same place
var thing = await _client.GetFromJsonAsync<Thing>("url");
_context.Add(thing);
await _context.SaveChangesAsync();
var thing = await _client.GetFromJsonAsync<Thing>("url");
_context.Add(thing);
await _context.SaveChangesAsync();
Tantrim
TantrimOP5mo ago
thanks for the help
Want results from more Discord servers?
Add your server