✅ Trying to store an entire table from a database into a hash table
Hello guys, consider the above code. What the code does is, it takes each table from the driving lesson database and insert them into a Hash Table.
My question is:
Was there a better way to store each table into a Hash Table?
8 Replies
Why do you need to store them in the HashMap in the first place?
Also HashMap isn't used much nowadays, you should use
Dictionary<K,V>
if you're storing all your data in memory why even use a database?
i'm also not sure where you got HashMap from, that's not in the BCL afaik because the C# equivalent is a Dictionary<TKey, TValue>
No ,.HashMap is something I created, Im not using the in built one, I needed to construct one from scratch for this project :c
The thing is I was told to use a "disconnected" architecture to make changes into the database
Like I load the objects, modify or add if needed, then connect back to db to upload them
Don't know why I should use a disconnected architrcture though, may be tk avoid 2 users modifying same data ?
Doesn't EF does the same ?
It does, yes
Unless you use
.ExecuteUpdateAsync()
hmm I'm a bit lost :c, EF core uses a disconnected approach?
so the use of the hash map is irrelevant ?
Yes
Oh okay, didn't know that
Thanks !