> > d) Do I need to dispose the the context on closing the window?
> Not only on that. you should create and dispose context for every
> action you do with a database: insert, delete, update, query etc.
That doesn't make any sense. If I dispose context after query then I
can't update the entities
> That doesn't make any sense. If I dispose context after query then I
can't update the entities without attaching them to new context. Waste
of resources.
Indeed. It's EF poor design, that they try to rework in EF core.
Still there are plenty of workarounds for this. For example attaching
> Indeed. It's EF poor design, that they try to rework in EF core.
> Still there are plenty of workarounds for this. For example attaching
> entities only by ids.
Attaching by ID? It's still attaching...
> DbContext is supposed to be used in request-response scenario (web
> sites, for example),