✅ wpf json CRUD(mvvm)
Could you tutorial how to use json config file ? I will do CRUD in the mvvm pattern through Json file.
42 Replies
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Imagine you have a User DTO (which represents the JSON of one of your endpoints)
And your API returns a list of Users for example...
So you would be using HttpClient to communicate with your API via a service.
As very barebone example imagine something like:
So in your mvvm you would have an instance of that service and u would call GetUsers to populate a ObservableCollection which would in turn populate your View.
This is very barebone simplistic explanation just to give u an idea.
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I don't think its a file
but could be
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
could be poor wording and language barrier
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
so I gave an example using an API and if that is not what he wants im sure he will say 😉
regardless from httpclient to readfile is very little changes
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Thanks your kindness reply, but I don't need Http client. Json file is located into my pc local
I can't use DBMS like mysql, postgre. And factory's environment is can't use internet. So I wanna use configure file like json, xml..
And I wanna implemented CRUD in the json file. And yea' I think IOC is clear. If give me a guideline or solution then I will step up than before
Thanks your kindness coding! But my intent is not using http
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I see
Oh I found FileUserservice!, I try it thanks!
then I would suggest you use SQLite which is local and can be used with efcore
SqLite uses a file also and provides more facilities suited to CRUD
oh yeah me too slow
Getting Started - EF Core
Getting started tutorial for Entity Framework Core
But I would see your sharing
"see your sharing"?
I see. Actually I used mysql using efcore. But site's situation is not proper. So I thought use json instead of Mysql
nah SQLite
for sure 🙂
u could even install mysql locally or postgresql
and not need internet it would work just in the same computer or in the factory intranet
My English haha.. I will see that Ms materials you shared
the term "no internet" can mean many things and sometimes it doesn't mean you cannot access a server inside the factory
fyi SQLite does not require setting up a server, it is a simple file (like a json file).
Oh ! It is good
But my config is small. Haha about 10
10 below.
Config
all in the red circle is no internet
so if there are multiple pcs u can even make your own local server
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Yea but why people use Mysql and Postgre? Because Dotnet support sqllight
Sqllight is good tool than them isn't it?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
SQLite is a great tool for small purpose
MySQL is popularized because old days of php and webhosting and its performance is no where near MSSQL or PostgreSQL
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
We just using mysql for database (just saving datas)
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
You guys in my situation , recommend sqllite than other dbms?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
The important things , It can't need any setup!!
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Yea I thought Json or xml as config file
I see
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Through app it is ok
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
But Originally I thought note pade
Also
Anyway in my level, I do all things sqllite and json... lol
Thanks your guys help to me