Sun「無用」
Explore posts from serversClass with same name as namespace
In the same app still (Ilanos), in my
Ilanos.Application
proj I have a lot of classes that are supposed to use the Joke
class.
However, for the sake of organization, I'm separating them like this:
The problem of that is the namespace name. The JokeResponseMapper
, for example, would be at the namespace Ilanos.Application.Mappers.Joke
while the Joke
entity/model class is at Ilanos.Core.Entities
.
The compiler complains that the Ilanos.Application.Mappers.Joke
namespace and the Joke
class "have the same name", even if they're different, is there a way to keep the organization and have the named classes as they are?24 replies
Unable to create DbContext
I'm trying to create by db tables right now, still in the start of a project.
I have a
ApplicationDbContext
in my Infrastructure project and I'm running dotnet ef migrations Initial
, that's all.
Project is public for now, could be seen here (yes, I know it's messy, I don't like clean architecture, I mostly don't know how to do it, not my style of coding)
Error Traceback:
48 replies
Testing practices and libraries
I'm just starting with testing, I'm not that much of a fan, most of the time for me it wasn't needed.
But'll just try it just in case I actually need it in the future (probably never :d)
What libraries should I use to make testing less bad?
And what practices are recommeded when testing?
3 replies
Transforming own type into ProblemDetails
So, I really like using
application/problem+json
to specify my results and for that I have my own ProblemResponse<T>
type Which has all the specification fields + extensions
The thing is that dotnet's ProblemDetails
type is not generic in any way, it uses a dictionary.
The type could be shortened to this
Is there any ways to transform from my type to theirs? or do I just use my type and not use the application/problem+json
header?
sry for the long text1 replies
Basic project structure for api/frontend
I've a small project I wanna build, but it'll need a frontend and a backend.
I'd like to learn some Blazor, so I'll use that as Frontend and normal asp.net w/controllers for backend.
I'm kinda stuck on project naming and organization though, do I use something like clean architecture, even if my project is way too small for that or do I just use like a
*.Api
, *.Blazor
and *.Common
?
What should be the recommended there to keep it simple as much as possible?51 replies
✅ ef not being able to update database migrations
I've been trying to learn aspnet and done just the basics of it. But when using
dotnet ef database update
, after adding a migration, the same SQLite Error 1: 'no such table: __EFMigrationsHistory'.
happens, eventhough that table is being created (or was supposed to be created) on the initial migration.
I only have 1 service and 1 model now, so that error makes no sense for me, as it's the only language that happened for me.58 replies
How to get configurations variables?
I'm new to asp.net, been trying to create some apis.
For now, I'm trying to get the db connection string, out of the
appsettings.json
. Is that possible or would I need to use something like .env
variables with some extra configuration?8 replies