z0mb
z0mb
CC#
Created by qwertyz on 2/16/2024 in #help
how can I run a raw sql query in asp.net mvc.
Depending on your use case, Dapper might be a great option for you in the future if you find you still prefer sql over linq
30 replies
CC#
Created by nox7 on 2/9/2024 in #help
✅ ASP Core Attribute Logic Help
Then your usage would look something like this:
[VerifyAccess(requireClientDashboardAccess: true, requireConnectedStripeAccount: false)]
[VerifyAccess(requireClientDashboardAccess: true, requireConnectedStripeAccount: false)]
6 replies
CC#
Created by nox7 on 2/9/2024 in #help
✅ ASP Core Attribute Logic Help
That is just some boilerplate stuff to get you going, but I believe this approach would accomplish what you need. Add, subtract, or modify parameters as you see fit.
6 replies
CC#
Created by nox7 on 2/9/2024 in #help
✅ ASP Core Attribute Logic Help
Verify they are logged in : I would just use the built in [Authorize] vs [AllowAnonymous] Verify they are accessing a dashboard that exists: Verify they are accessing a dashboard they have authorization to view: Verify for some routes the Dashboard has a connected StripeAccount: https://paste.mod.gg/xtgdonyhekrc/0
6 replies
CC#
Created by nox7 on 2/9/2024 in #help
✅ ASP Core Attribute Logic Help
Couldn't you just have one attribute, and pass in some parameters to configure what exactly you need for that specific endpoint? Then you can logically determine if they should be able to access the endpoint based off of your requirements and the provided parameters? That would avoid multiple unnecessary DB calls.
6 replies
CC#
Created by z0mb on 2/6/2024 in #help
Visual Studio (2022 Professional) Quick Fix not offering "Install Package X" option.
Unfortunately no luck, i'll just have to get over it and manually work it when adding common packages.
9 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
Really how you organize it is up to you, I can't decide that for you, but just providing the option that you can create a folder to hold like items together. Ultimately each lesson is it's own .cs file and can be organized as you see fit
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
Or however your course is structured.
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
Just providing options, but maybe something like this...
MyLessons
|— MyLessons.sln
|— Loops
| \— ForLoop.cs
| \— WhileLoop.cs
|— Files
| \— OpenFile.cs
| \— ReadFile.cs
MyLessons
|— MyLessons.sln
|— Loops
| \— ForLoop.cs
| \— WhileLoop.cs
|— Files
| \— OpenFile.cs
| \— ReadFile.cs
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
It may make sense to put like lessons into folders as well, if you'd like
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
Or name them however you see fit
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
So with this, you only need one Program.cs then you can create a new class that will be resposnbile for each lesson. So you may have: Program.cs Lesson1.cs Lesson2.cs Lesson3.cs etc...
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
If you wish to start with approach 2 that will work, so you have a sln created with a single project already?
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
So really at this point you just need to decide which approach you want to take, and if you have questions we can help with the decided upon approach. But we need to know which one you are wishing to proceed with
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
There's two different approaches you can take. 1) One sln, multiple projects (each with their own Program.cs file). 2) One sln, one project, multiple classes, and your Program.Cs controls which one you wish to run.
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
If you create a project within the sln, it should provide you with a Program.cs file tied to that project you created.
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
I'm not sure I follow the question
137 replies
CC#
Created by z0mb on 2/6/2024 in #help
Visual Studio (2022 Professional) Quick Fix not offering "Install Package X" option.
I'll give it a shot
9 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
That way you don't end up with Program49.cs at some point, lol
137 replies
CC#
Created by MorryMar on 2/7/2024 in #help
files
This is a pretty standard approach and should be followed
137 replies