Re: [Firebird-net-provider] Entity Framework: Best practices to work in a multiuser environment

2016-03-26 Thread Jiří Činčura
> 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), w

Re: [Firebird-net-provider] Entity Framework: Best practices to work in a multiuser environment

2016-03-26 Thread Геннадий Забула
> 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 entitie

Re: [Firebird-net-provider] Entity Framework: Best practices to work in a multiuser environment

2016-03-26 Thread Jiří Činčura
> > 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

Re: [Firebird-net-provider] Entity Framework: Best practices to work in a multiuser environment

2016-03-25 Thread Геннадий Забула
EF context is implementation of unit-of-work pattern, it is not repository pattern. > 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. > 3. As lo

Re: [Firebird-net-provider] Entity Framework: Best practices to work in a multiuser environment

2016-03-25 Thread Jiří Činčura
> a) Is the method described above considered as good practice? From what you've written, yes. > b) Basically it is a connected Context until the user refreshes the data. > In > this case the context is recreated. No problem with that. > c) In order to manage multiuser environment, do I need to