c# - hook in the entity framework generated proxy -
currently i'm building application supports localization of database content. entities have 2 entities.
- entity - entitytranslation
the entity has same fields, values default language. translation table supports other languages. whenever want retrieve translated result have query on translation entity. makes code less readable desired.
at first thinking hook in repo's. so, when entity derived localizedentity check users language , if not default fetch translation entity table , copy them on entity. (simple explenation, in practice lot more work.)
though, when entity accessed via navigation property not work. handled entity framework via generated proxy. question is, can somehow hook generated proxy , add custom logic it? tried find documentation indicate starting point hook in process, thusfar not succesful. hoping did this.
Comments
Post a Comment