✅ 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•3mo 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•3mo ago
Message Not Public
Sign In & Join Server To View
I don't think its a file
but could be
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
could be poor wording and language barrier
Unknown User•3mo 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•3mo 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•3mo 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