Joschi
Joschi
CC#
Created by derole on 3/20/2025 in #help
AutoMapper example projects with mapping profiles
Yes it is considerably faster than AutoMapper, because reflection is kind of slow. It honestly won't really matter in most of the projects, but nice to have I guess.
64 replies
CC#
Created by derole on 3/20/2025 in #help
AutoMapper example projects with mapping profiles
Nothing much to look at tbh. The documentation is also quite good.
64 replies
CC#
Created by derole on 3/20/2025 in #help
AutoMapper example projects with mapping profiles
First thing would be. Are you really sure you want to use AutoMapper? Debugging it may cost you more time than you save in the long run. And did you consider alternatives like Mapperly, which source generates the mapping methods.
64 replies
CC#
Created by codelilac on 3/19/2025 in #help
What blazor template do I start from...
It is not obsolete. . Net 8 introduced rendermodes and thus the possibility of mixing WASM and Server interactivity. Auto switches between them, automatically. But with this introduction MS moved to a new template, which will allow you to do this mixing if you like. There is also a pure WASM template. And if you want your old familiar pure Server app back. Just create a new project with a global server rendermode and delete the second project.
2 replies
CC#
Created by Mango on 2/20/2025 in #help
Blazor cross component state mutation
Quite a lot of libraries like MudBlazor implement this. You could look at their code.
7 replies
CC#
Created by Rai on 2/21/2025 in #help
EFCore Multi-level relation
Yes such relations are possible. You just define each relationship individually. But I don't understand what you are asking in the last sentence?
4 replies
CC#
Created by Nada on 2/15/2025 in #help
✅ Need Advice: Choosing the Right .NET Version for Our Project
Because then as you said we need a WS connection nearly all the time. And that is the exact problem Auto tries to solve
83 replies
CC#
Created by Nada on 2/15/2025 in #help
✅ Need Advice: Choosing the Right .NET Version for Our Project
Most pages should work in WASM only. If you have Server only components on most pages you loose the advantage of auto and should just run Server
83 replies
CC#
Created by Nada on 2/15/2025 in #help
✅ Need Advice: Choosing the Right .NET Version for Our Project
Auto uses WS only if the WASM isn't cached in the browser
83 replies
CC#
Created by Nada on 2/15/2025 in #help
✅ Need Advice: Choosing the Right .NET Version for Our Project
I really like Blazor and use it exclusively for my personal projects and work. But at work we just got a small internal website. As ToBeCo said you will have to decide if you can live with certain drawbacks of each of the blazor models. Server Side will require a constant Websocket. That can be problematic, because scaling those is really hard. I'm not sure at what point you run into problems but I have heard numbers in the hundreds of concurrent users depending on your server. Blazor WebAssembly poses a longer initial load time, because the browser has to fetch the. Net runtime on the first visit. Also all your WASM code is accessible to the end user. There are no secrets in your client application code. Thats not too different from other UI technologies but always something you have to keep in mind for security. Then there is the new auto mode. It will first open a WS connection and run in Server Mode. Then download the runtime in the background and switch to WebAssembly on the next visit / navigation. This technically alleviates the WASM problem of a slow initial load time. And also the scalability issue of Server. But you win a lot of technical complexity.
83 replies
CC#
Created by Faker on 2/15/2025 in #help
✅ StringBuilder in C#
StringBuilder is mostly used for string creation not manipulation. For example you want to return a message to the user, but depending on the context you may add a lot of different lines. Instead of directly merging the strings you would use a StringBuilder.
33 replies
CC#
Created by Faker on 2/8/2025 in #help
How to read stack trace errors
Stack traces will often contain a lot of lines of MS library code. Because the exception happens down there. But you can often assume, that the actual error was produced in your code. So the first step is always to read and understand the actual error / exception. After that searching for the first mention of your own code in the stack trace is a good second step.
40 replies
CC#
Created by Zoli on 1/3/2025 in #help
Resolving Entity Framework Core Tracking Issues with Shared Relationships in .NET MAUI and SQLite
Not really. Most of the time your dbcontext should not outlive a SaveChanges call. One dbContext should more or less be used for one unit of work.
6 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Not too familiar with generation, because we work with blazor and just share our dtos. I only used Kiota (a few years ago) and that doesn't really care about your defined errors. It will just throw exceptions on non success in any case.
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
To me it sounds like you should give minimal apis with the REPR pattern a try. Like FastEndpoints. It also has strongly typed endpoint methods with union responses, which will end up in the OpenApi schema.
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Would you elaborate how? Because that would be something really interesting to build.
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Some people only have one endpoint in each controller class when using mvc. It is often done to reduce the dependencies in each controller. Regarding your problems above with exceptions and results. The advantage of an Result implementation is, that you are forced to handle errors. And you are aware that errors could happen in a method. Unless it is documented or you read the methods source, you cannot know if and which exceptions it may throw. In APIs this will result in 500 responses, which is often undesired. What we currently do is to map our different Error types to the corresponding api error. So a NotFoundError would return a 404. Having it well documented in an OpenApi schema, without manually defining the possible errors that could happen at this specific endpoint is really hard. Probably even impossible in MVC. Mainly because everything is boiled down to IActionResult. And its hard to know at compile time which actual types could maybe occour. But honestly not that important unless you develop an API meant for public consumption.
160 replies
CC#
Created by Bananas on 11/24/2024 in #help
Manage small university project
No! You won't be able to distinguish between it giving good advice and it hallucinating.
23 replies
CC#
Created by Bananas on 11/24/2024 in #help
Manage small university project
Don't worry about something like that as a beginner. Just try to write down what you want your app to do and get started. Don't worry about the "correct" way of doing it, just try to get something working.
23 replies
CC#
Created by Ꜳåąɐȁặⱥᴀᴬ on 11/23/2024 in #help
✅ doubts about migrations
Yeah right thinking about it, they have to be or EFCore could not migrate the DB at runtime.
10 replies