Entity Framework; Object-Oriented delete -


i'm building out stock management system @ moment, using entity framework 4.

a little background, entities go bit (only showing needed info)

product --> productlocations

warehouselocation --> has many productlocations

each productlocation has quantity

what i'm trying have when call product.takefromlocation(wl warehouselocation, qty integer), deletes productlocation if quantity falls zero.

however... product entity, productlocation, , meant persistance ignorant. i'm using poco ef templates, couple of modifications produces ientities interface, , generates fakeentities using in-memory versions testing. means entities not know entity framework, , don't inherit or implement interfaces, context.deleteobject() out of bounds.

anyone encountered similar scenario , got ideas on how round this?

i kind of thought if savechanges() on context partial method, extend check 0-quantities - it's going saves, bit of drag on 90%+ of operations aren't doing this.

i in savingchanges event, not savechanges().

as performance "overhead," suspect it's somewhere between trivial , un-measurable.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -