I am trying to figure out how best to work with BLOBs and entities.
I am working with EF 4.1 and using POCO / DbContext
So, here is an example table:
MyTable Key int SomeFields ... ABlob (ok, it actually a Text, but whatever)
Now, sometimes, when I select from MyTable, I want to turn on the BLOB field, but for a long time I do not.
Also, sometimes when I update MyTable, I want to update the BLOB. but a lot of time, I do not.
I can use anonymous types for the select operation, but I cannot find a way to make this work for updates at all (I cannot have 2 different classes in the same context mapped to the same table, if I try to use inheritance, I get runtime error because EF is expecting a discriminator column).
Of course, using EF does not mean that I always have to query all my BLOBs. What am I missing here?
source share