C
C#4mo ago
kate!

Class Naming Conventions

I'm currently renaming all the classes in my Discord Bot project but I'm stumped to decide what the suffix should be for a class that the wrapper for a collection in a database. Context wouldn't make sense, since I am not using Entity Framework. Currently I have; - Services for classes that just do things (like handling guild logging events) - Modules for the interaction modules that are used by Discord.NET (handling slash commands) - Models Whatever is the type for the collection - Controller ASP.NET controllers, duh.
6 Replies
Angius
Angius4mo ago
If — for whatever godforsaken reason — you're not using EF, you are hereby permitted to use repositories
kate!
kate!4mo ago
i'm only not using EF because I prefer having as much control over my data and schemas in my database (and when I started this project, I had no idea how to use it with MongoDB)
Angius
Angius4mo ago
Ah oof ouch Mongo Sure, just use the Mongo driver here
kate!
kate!4mo ago
Yeah I am I'm not that insane lol
Gramore
Gramore4mo ago
Repository floats around but that's usually associated with the pattern of the same name or just like MongoService 🤷‍♂️
There are only 2 hard problems in computer science 1. Naming things 2. Cache Invalidation 3. Off by one errors
Tbh i have used Context even if just using dapper or w/e b/c context == database in my mind 😛
kate!
kate!4mo ago
Repository sounds good and there are no words used in the suffix that other classes use, so I'll probaby use that But it's only one collection per-class (hence why I wouldn't do Context)
Want results from more Discord servers?
Add your server
More Posts
✅ [AVALONIA] Get all coordinates along a PolylineWhilst you define the points for a Polyline, is there any way that I can get or calculate the rest oCleaner NavigationView implementation (Avalonia)I'm currently porting an existing project that i didn't write from WinUI3 to Avalonia. The project Iprogram closing early```cs Console.WriteLine("What was the digital portfolio mark (out of 35)?"); int dpMark = int.Parse(Fully stuck on making a clickable game object system in unityim fully stuck right now, I cant find a good solution for this problem, so basically im making a gam✅ [AVALONIA] Return Coordinates (Only if a Polyline is present in those coordinates)Ive completed my A* Pathfinding but need to dump alot of uneccesary coordinates from the created grineed some help understanding configuration comming from "Environment Variables"so I read some docs that says I should store secrts for development using the Secrets.json service. ✅ Return Coordinates (Only if a Polyline is present in those coordinates)Ive completed my A* Pathfinding but need to dump alot of uneccesary coordinates from the created griI need help debugging c# event-based reliable UDP implementation.Note: I know that there are libraries that can do this and even more. But for my own reasons, I wantHow to register with email AND username?I am using this tuto: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identityWhy targetRadius should be "43"?Hi, I am practicing C# by replicating a simple exercise in *Monogame*: the code draws a ball, and wh