13 Replies
for starters I wouldnt return null to something expecting a list
can you point me to the method where?
where am i returning null? 😮
GetUserLessons
oh yeah thats a mistake for sure , thx.
see anything else?
Why do you have a repository and cache a list of lessons?
Yeah thats what i was wondering about, whats the best practice for this?
don't have two things for the same state
I mean if i load all user related lessons i can just place them in a private field and work on them no?
what do you mean? repo only performs db operations
it doesnt save an in app state
db is for saving state. wdym
Yeah but if if i dont want to make a db call each time smth happens on the ui
I can work on the fields and only save to db when needed no?.
or its the wrong way
Like for example a user went into a lesson and didnt start it, why would i load it from the db? no changes happened
Or if he gave no answers
so why read a non changed entity from the db ?
SetActiveLesson - that's just setting some kind of ui state, but yet its making repo calls as well
It's not clear what is transient/ui data and what is permanent/repo data
db reads are not that expensive, normally you want to avoid using a cache
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.