Sun「無用」
Explore posts from serversDTDrizzle Team
•Created by Sun「無用」 on 9/6/2024 in #help
How to start with drizzle?
I'm reading docs and there doesn't seem to be any form of "how to get started" section or any installation area.
It says a lot why to use it, but not how to use it. And the learn tab also didn't have any project starter.
Is there no ways to do something like
prisma init
, that just starts a simple drizzle configuration or some documentation that gives that information?3 replies
Class 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
PPrisma
•Created by Sun「無用」 on 6/1/2024 in #help-and-questions
Cleaning code
So, just building a basic scoreboard side project, which I need teams and scores for it.
Is there any ways to clean up these models? They just seem kinda clunky to me, dunno if I'm the problem here.
2 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
Setting up Client Components
I'm trying to setup a simple counter client component, code can be seen below. Code is minimal so it's easy to test it (first time using client components on hono)
When using the example given in the docs, an "obvious" error that document is not defined would happen, since I'm in the server.
Code:
5 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
createResource returning undefined when data is fetched
I'm just learning solid and did something like a hook? maybe? dunno.
Anyways, I'm just calling
createResource
with a fetch on it and returning it's json.
But, for any reason, that fn is returning undefined, even when the data is properly fetched("tested" by logging the json).
Code: 105 replies