Metalkon
Storing Item Information?
Question:
I'm making a crafting game with blazor and asp.net as a portfolio project and i'm struggling with deciding how to do something.
If I want to save item quantities and such in the users inventory on the database, but general item information (name/description/price/etc) elsewhere for easy changes down the road, what would be the best way to go about this?
The saved item information elsewhere would mostly be for display purposes when inspecting an item but also used for a shop for them to buy new materials (price and such). I assume saving to a json/xml may be the way to go, but how to effectively access that information both client and server side is making me wonder without being super inefficient.
---
Would this be the way to go here?
In a shop controller where a user wishes to buy an iron ingot for 6 gold or something... Create a user object (with the gamedata object which holds inventory/gold/lv/exp/etc), create a iteminfo object from a json, check if user has enough gold for the item id given to the controller, make changes for purchase, save info, update things on client side.
On client generate the iteminfo object (json also saved on client) on a page along with an inventory object from the server, page lists the quantities that the user has, and attaches iteminfo information on the items.
(And what about dependency injection for iteminfo?)
8 replies
Blazor WebAsm AuthStateProvider
Question:
I am working on new project that will use a custom auth setup based on an old unfinished project. In my old project I used a custom authstateprovider (got it from a .net6 tutorial a year ago, barely know how it works) and i'm wondering if anyone could point me in the right direction?
Here's the customauthstateprovider used in my old project
https://github.com/Metalkon/Fantasy-Web-App/blob/master/Fantasy%20Blazor/Services/CustomAuthStateProvider.cs
I'm trying to figure out how to avoid using this and maybe use something a bit more official, standard, or built-in without changing my backend (it returns a jwt and refresh token atm) but i'm struggling to find useful information currently.
1 replies
❔ Passwordless Authentication? (ASP.NET)
What's the simplest way to implement passwordless authentication to an mvc app? I wish to have a simple authentication setup for my app and one that simply sends an email (with url/code) to login with seems to be the easiest of the options that don't hold passwords in my db.
(i'm still learning asp.net and don't wanna scaffold the default identity package into my project as it's too much and comes with project creation anyways, struggling to find good tutorials, libraries, frameworks, ect to do this)
14 replies
❔ Having MSSQL Cert Issues In a ASP.NET Project
Anyone have any idea on how I can solve this issue? It's only a problem with my new .net 6 project even though i'm not having this issue on my .net 5 project which is almost identical.
I'm trying to migrate (update-database command) my mssql database with entity framework on a new asp.net core 6 mvc project on visual studio but i've been stumped on this error all day without finding a solution.
I tried doing the instructions on this troubleshooting page but nothing happened, chatgpt isn't saying anything useful, and the google search results i've checked haven't helped much either.
https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/error-message-when-you-connect
4 replies
❔ Becoming An ASP.NET Developer
I spent a good amount of time learning programming and C# last year and I'm currently at the early stages of learning ASP.NET where I can only make very simple mvc projects (ex: crud projects) and have a shallow understanding of how it all works (http requests, pipeline, webdev basic concepts, ef, ect).
My goal is to become ready to start sending out resume's as a .NET or ASP.NET developer by this summer.
With that in mind what are your thoughts on me just focusing mostly on learning about building API's to link with other project types (like winforms/wpf/maui/unity) and not worry much about mvc or websites?
10 replies
ASP.NET Video Recommendations?
I'm trying to find some video's that go over how/why/where all of the code itself in ASP.NET gets passed around that goes over how it all works step by step to enhance my understanding of it so I won't be lost in what i'm doing.
Does anyone have any recommendations for such videos?
So far the best video I have is this one but i'm trying to even learn more. (he goes over how some of the mvc code interacts with each other in this vid though not much else)
https://youtu.be/Ea-Ms6znJpE
5 replies
Is this how all API's work?
https://youtu.be/ZveW4_ZJtVY?t=475
I've always struggled with the concept of what an API actually is in the program since every example has been way too abstract (like restaurant waiters and such) or never showed what it was actually working with. But after watching this video I think i'm finally getting it (url request with information, receive json, etc) but the example is if you're using another's service for your own app/website.
Question:
Is this how all API's work? Even on ones own website and app speaking between frontend and backend?
5 replies
XAML Tutorials For MAUI?
Does anyone know if there are any good tutorials/courses out there that teach XAML for beginners who have never touched a markup langauge (not even html) before with the focus on MAUI?
I've been checking a few MAUI tutorials and none of them did much to teach XAML itself (it's written structure, both why and how, and other stuff) and I was told somewhere that anything XAML related learned for xamarin/wpf wouldn't even be compatible with MAUI.
2 replies